I've a Link button on a web page which is a child page of a master page. Here is the link button code
<asp:LinkButton ID="lb_submit" ClientIDMode="Static" runat="server"
CssClass="btn btn-green submit-button pull-right btn-block">
<span class="start-text" style="font-family:Arial;font-size:14pt;">Start</span>
</asp:LinkButton>
The way I tried to do was
$('#lb_submit').click();
But its not firing the actual click event of that link button.
Also I tried
$('#lb_submit').trigger('click');
That also didnt help me to solve that issue. Actually my purpose was to trigger that button when ever the enter key on anywhere of the page. That event is working fine and I confirmed it. But am sharing that function also
$(document).on("keypress", function (e) {
if (e.keyCode == 13) {
// Cancel the default action on keypress event
e.preventDefault();
$('#lb_submit').click();
}
});
Im not getting an idea what I did wrong
<div class="col-md-2 "><a href="javascript:WebForm_DoPostBackWithOptions
(new WebForm_PostBackOptions("ctl00$cp_body$lb_submit", "", true, "", "", false, true))"
class="btn btn-green submit-button pull-right btn-block" id="lb_submit">
<span style="font-family:Arial;font-size:14pt;" class="start-text">Start</span></a>
</div>
$('#lb_submit')find the element?