JavaScript学习
1)点击文字改变内容
JS代码
代码
1 function Mode(){
2 var eHand = document.getElementById('hand');
3 if (eHand.innerHTML == '手动')
4 {
5 eHand.click = tohand();
6 eHand.innerHTML = '自动';
7 }
8 else
9 {
10 eHand.click = toauto();
11 eHand.innerHTML = '手动';
12 }
13 }
2 var eHand = document.getElementById('hand');
3 if (eHand.innerHTML == '手动')
4 {
5 eHand.click = tohand();
6 eHand.innerHTML = '自动';
7 }
8 else
9 {
10 eHand.click = toauto();
11 eHand.innerHTML = '手动';
12 }
13 }
HTML代码
1 <td width="15%" align="right">
2 <div class="content_title" align="center">
3 <a href="#" onclick="Mode();"><span id="hand">手动</span></a>
4 </div>
5 </td>
2 <div class="content_title" align="center">
3 <a href="#" onclick="Mode();"><span id="hand">手动</span></a>
4 </div>
5 </td>