简体   繁体   中英

Clicking a radio button using javascript not working in IE

I have a button, by clicking it a radio button get clicked and which will show a hidden div

below is my code

<input onClick="check_hidden_radio_email();" type="button" id="emailthis"  value="email cli script" name="emailthis"></input>   
<label onClick="showemailbox();" id="hiddenLabel"><input type="radio" id="hiddenOne" name="hidbutton" value="Yes" <?php if(isset($_POST['hidbutton']) && $_POST['hidbutton'] == 'Yes')  echo ' checked="checked"';?> />

<div id="email-box" style="display:none;" >
<input class="textbox" type="text" id="emailbox" name="emailbox" value="<?php if(isset($_POST['emailbox'])) { echo htmlentities ($_POST['emailbox']); }?>"  placeholder="Enter Your Email ID here" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter Your Email ID here'"/>
<input type="submit" id="send"  value="send" name="send"></input>
</div>

and I am using below javascript to check the radio button

  function check_hidden_radio_email(){
    hiddenOne.checked = true;
    $('input:radio[name=hidbutton]:checked').click();
}   
  function showemailbox(){
    $('#email-box').slideDown("fast");
} 

This code is working perfectly in FF and chrome, but in IE, whenever I click the emailthis button, it is not checking\\clicking the radio button. How can solve this issue with IE

我看到的一个问题是, label标记从未关闭。

<label onClick="showemailbox();" id="hiddenLabel">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM