How can we use multiple Ids/content in a single selector in JQuery -



How can we use multiple Ids/content in a single selector in JQuery -

please suggest me proper jquery selector this. how optimise this?please suggest

$("#name").keyup(function (event) { if (event.keycode == 13) { $("#search").click(); } }); $("#username").keyup(function (event) { if (event.keycode == 13) { $("#search").click(); } });

please replace code following.

$("#name,#username").keyup(function (event) { if (event.keycode == 13) { $("#search").click(); } });

jquery jquery-selectors

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -