How to handle multiple ids at a time in jquery
To handle 2 or more id fields with jquery for below code,use just comma(,) separator in the jquery
[source language="html"]
<div id="id"/>
<div id="id1"/>
<div id="id2"/>
[/source]
as
[source language="javascript"]
$(document).ready(function(){
$("#id,#id1,#id2").click(function(){
//Your logic here ...
});
});
[/source]
this is a simplest way.
Thanks...
[source language="html"]
<div id="id"/>
<div id="id1"/>
<div id="id2"/>
[/source]
as
[source language="javascript"]
$(document).ready(function(){
$("#id,#id1,#id2").click(function(){
//Your logic here ...
});
});
[/source]
this is a simplest way.
Thanks...
Comments
Post a Comment