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...

Comments

Popular posts from this blog

Simple Mail Sending Contact Form using PHP and Jquery

Codeigniter with Admin LTE

onclick anchor tag open url in bootstrap model