开发者

element onChange javascript not working

<select name='cmg_select'  onChange="javascript:window.location.href='index.php?'+this.value">
    <option value='pening'> pening </option>
    <option value='complete'> complete </option>
    <option value='pening'> pening </option>开发者_高级运维
</select>

The concatenation is not working.


  1. Remove the javascript: portion
  2. Remove the href portion

The result :

< select name='cmg_select' onchange="window.location='index.php?'+this.value" >


Try this instead

<select name='cmg_select' onChange="window.location.href='index.php?'+this.options[this.selectedIndex].value">
<option value='pening' > pening </option>
<option value='complete' > complete </option>
<option value='pening' > pening </option>
</select>


Remove the javascript: from the onchange attribute.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜