以下有單引號(hào)('')的地方為什么使用單引號(hào),用雙引號(hào)("")可以嗎?上面對(duì)應(yīng)的使用單引號(hào)('')或雙引號(hào)(""),下面使用到或是函數(shù)調(diào)用時(shí)也要對(duì)應(yīng)使用引號(hào)('')或雙引號(hào)("")
........
var?Txt1?=?parseInt(?document.getElementById('txt1').value?);
//獲取第二個(gè)輸入框的值
????var?Txt2?=?parseInt(??document.getElementById('txt2').value?);
//獲取選擇框的值
????var?Select?=??document.getElementById('select').value?; //獲取通過下拉框來選擇的值來改變加減乘除的運(yùn)算法則
????var?result?=?'';
......
? document.getElementById('fruit').value?=?result;
......
?<input?type='text'?id='txt1'?/>?
???<select?id='select'>
.......
<input?type='text'?id='txt2'?/>?
???<input?type='button'?value='?=?'?onclick?="count()"/>?<!--通過?=?按鈕來調(diào)用創(chuàng)建的函數(shù),得到結(jié)果-->?
???<input?type='text'?id='fruit'?/> ??
.......
2016-03-21
http://zhidao.baidu.com/link?url=Wc-gxNfHBDO3PeSoM5q7Z7yqO-jHy0zNeS0gjzUhf_GszSjuVN9s-49NUCaIeC6NzhacLMxRtsTSOTJH_6poJK
這個(gè)網(wǎng)址說的比較詳細(xì),值得參考
2015-11-23
完全沒有看懂你在說什么, 在html中屬性最好用雙引號(hào),當(dāng)然單引號(hào)也不會(huì)報(bào)錯(cuò)。js中單引號(hào)和雙引號(hào)都可以,但是要成對(duì)匹配使用。
2015-11-23
求解啊