JS how to emulate click on element javascript example

 
    <input type="radio" name="nmRadio" id="idOne" onclick="javascript:myFc(this)">One<br>
    <input type="radio" name="nmRadio" id="idTwo" onclick="javascript:myFc(this)">Two<br>
    <input type="radio" name="nmRadio" id="idThree" onclick="javascript:myFc(this)">Three<br>
 
    <script>
        if (!document.all && document.getElementById) document.getElementById('idTwo').click();
 
        function myFc(ts) {
            alert(ts.id);
       }
 
    </script>
This entry was posted in Javascript css html and tagged . Bookmark the permalink.


Comments are closed.

531 views