以下有單引號('')的地方為什么使用單引號,用雙引號("")可以嗎?上面對應(yīng)的使用單引號('')或雙引號(""),下面使用到或是函數(shù)調(diào)用時也要對應(yīng)使用引號('')或雙引號("")
........
var?Txt1?=?parseInt(?document.getElementById('txt1').value?);
//獲取第二個輸入框的值
????var?Txt2?=?parseInt(??document.getElementById('txt2').value?);
//獲取選擇框的值
????var?Select?=??document.getElementById('select').value?; //獲取通過下拉框來選擇的值來改變加減乘除的運算法則
????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
這個網(wǎng)址說的比較詳細(xì),值得參考
2015-11-23
完全沒有看懂你在說什么, 在html中屬性最好用雙引號,當(dāng)然單引號也不會報錯。js中單引號和雙引號都可以,但是要成對匹配使用。
2015-11-23
求解啊