javascript - Press enter key on a web page -
there texbox on fb groups. html code:
<input type="text" class="inputtext textinput" name="freeform"         placeholder="gruba başkalarını ekle" autocomplete="off" aria-autocomplete="list"         aria-expanded="false" aria-owns="typeahead_list_u_jsonp_4_2" aria-haspopup="true"         role="combobox" spellcheck="false" aria-label="gruba başkalarını ekle"         id="u_jsonp_4_3">   and input name using javascript code.
document.getelementsbyname('freeform')[0].value = '" + textbox2.text + "';   but there no button click , using sendkeys.send("{enter}") event click enter. 
the problem sendkeys.send not enough me , wanna press enter key using ways.
how can hit enter key without using sendkeys.send?
you can achieve in jquery quite creating event , assigning keycode of enter key, 13:
var e = jquery.event('keydown'); e.which = 13; $('input[name="freeform"]').trigger(e);      
Comments
Post a Comment