脚本在我的android浏览器上不起作用
script not working on my android browser
我使用wordpress创建了一个网站,并制作了一个脚本,人们可以在其中选择一个单选按钮,然后显示多个选择。但脚本不适用于android互联网浏览器我做错了什么
这是表格:
<form id='form-id' action="http://trainingzuid.nl/wp-content/php/mail.php" method="post">
<table>
<tbody>
<tr>
<td><input id='pt' name='test' type='radio' /> personal training</td>
<td><input id='gt' name='test' type='radio' /> group training</td>
<td><input id='bt' name='test' type='radio' /> both</td>
</tr>
<tr>
<td><div id='pur' style='display:none'>Purpose:</div></td>
</tr>
<tr>
<td><div id='gf' style='display:none'><input type='radio'> general fitness</input></div></td>
<td><div id='lw' style='display:none'><input type='radio' /> losing weight</div></td>
<td><div id='bt1' style='display:none'><input type='radio' /> both</div></td>
</tr>
<tr>
<td><div id='kb' style='display:none'><input type='radio'> kickboksen</input></div></td>
<td><div id='b' style='display:none'><input type='radio' /> boksen</div></td>
<td><div id='kkb' style='display:none'><input type='radio' /> kids kickbosen</div></td>
</tr>
<tr>
<td><div id='bf' style='display:none'><input type='radio'> ballet fitness</input></div></td>
<td><div id='ch' style='display:none'><input type='radio' /> cross hit</div></td>
<td><div id='t6' style='display:none'><input type='radio' /> training 6</div></td>
</tr>
<tr>
<td><div id='t7' style='display:none'><input type='radio'> training 7</input></div></td>
<td><div id='t8' style='display:none'><input type='radio' /> training 8</div></td>
<td><div id='t9' style='display:none'><input type='radio' /> training 9</div></td>
</tr>
<tr>
<td><p><input type="text" name="name" placeholder="First and last name"></p></td>
<td><p><input type="text" name="email" placeholder="e-mail adress"></p></td>
</tr>
<tr>
<td><p><input type="text" name="phone" placeholder="Phonenumber"></p></td>
<td><p><input type="text" name="message" placeholder="additional message"></p></td>
</tr>
</tbody>
</table></center>
<center><input type="submit" value="Submit"></center>
</tbody>
</table>
js代码:
<script>
$('#form-id').change(function() {
if ($('#pt').attr('checked')) {
$('#pur').show();
$('#gf').show();
$('#lw').show();
$('#bt1').show();
} else {
$('#pur').hide();
$('#gf').hide();
$('#lw').hide();
$('#bt1').hide();
}
if ($('#gt').attr('checked')) {
$('#pur').show();
$('#kb').show();
$('#b').show();
$('#kkb').show();
$('#bf').show();
$('#ch').show();
$('#t6').show();
$('#t7').show();
$('#t8').show();
$('#t9').show();
} else {
$('#pur1').hide();
$('#kb').hide();
$('#b').hide();
$('#kkb').hide();
$('#bf').hide();
$('#ch').hide();
$('#t6').hide();
$('#t7').hide();
$('#t8').hide();
$('#t9').hide();
}
if ($('#bt').attr('checked')) {
$('#pur').show();
$('#gf').show();
$('#lw').show();
$('#bt1').show();
} else {
$('#pur2').hide();
$('#gf1').hide();
$('#lw1').hide();
$('#bt12').hide();
}
});
</script>
我找到了很多剧本,但这是唯一一个与wordpress有关我的主题的作品。
感谢THNX的所有帮助!!
如果你在Android设备上使用Chrome浏览器,你应该会得到与桌面版本相同的结果。试试其他设备、浏览器,看看你是否遇到同样的问题。
相关文章:
- 当我在浏览器中打开HTML文件时,javascript不起作用
- Javascript的某些部分在Chrome中不起作用,但在其他浏览器中可以完美工作
- 为什么简单的Promise语句在浏览器中不起作用
- 用于播放背景音乐的嵌入式flash播放器在IE浏览器中不起作用
- 带有Safari的Javascript;不起作用——所有其他浏览器都起作用
- 使用Javascript的Ajax请求在iPhone浏览器中不起作用
- 谷歌浏览器模式正则表达式在使用setCustomValidity动态创建表单时不起作用
- 为什么我的谷歌浏览器扩展程序在谷歌浏览器版本 41.0.2272.89 中不起作用
- 为什么这个JavaScript在浏览器中不起作用
- 多个 socket.io 客户端连接不起作用(谷歌浏览器,火狐浏览器)
- 脚本在web浏览器控件中不起作用
- 禁用浏览器中的后退按钮不起作用
- 将JSON对象转换为敲除observable在IE8中不起作用,但在所有其他浏览器中都起作用
- jQuery在我的网站上不起作用,但在我的浏览器上起作用
- 角度路由;在浏览器中直接访问URL时不起作用,但在单击时起作用
- 转到顶部按钮在Firefox浏览器中不起作用
- javascript代码在浏览器中不起作用
- JavaScript文件在浏览器中不起作用,但它在代码笔中起作用
- Javascript浏览器通知不起作用
- 为什么javascript在谷歌浏览器上不起作用