href...>"
On Dec 30, 2:36 am, Kean <shenan...@gmail.com> wrote:
> I'd be interested to see your html too.
>
> Ok another try
>
> jQuery(function($){
> $("a.clicker").click(function() {
> alert(this.id);
> return false;
> });
>
> });
>
> On Dec 29, 7:54 pm, buttman <nbvF...@gmail.com> wrote:
>
> > Still not working... I still get a blank popup window :( This is all
> > supposed to be inside the "document.ready()" thing, right?
>
> > On Dec 29, 10:22 pm, Kean <shenan...@gmail.com> wrote:
>
> > > This is even better.
>
> > > jQuery(function($){
> > > $("a.clicker").click(function() {
> > > alert(this.id);
> > > });
>
> > > });
>
> > > On Dec 29, 7:21 pm, Kean <shenan...@gmail.com> wrote:
>
> > > > Try this then
>
> > > > jQuery(function($){
> > > > $("a[class=clicker]").click(function() {
> > > > alert(this.id);
> > > > });
>
> > > > });
>
> > > > On Dec 29, 4:27 pm, buttman <nbvF...@gmail.com> wrote:
>
> > > > > That doesn't work. When I do
>
> > > > > alert(this.id)
>
> > > > > in that function, nothing comes up. Additionally, "alert(this)" just
> > > > > displays the url.
>
> > > > > On Dec 29, 7:16 pm, Mike Alsup <mal...@gmail.com> wrote:
>
> > > > > > > I have a bunch of anchors that look like this:
> > > > > > > ############
> > > > > > > < a href="" class="clicker" id="click_1">click here</a>
> > > > > > > < a href="" class="clicker" id="click_2">click here</a>
> > > > > > > < a href="" class="clicker" id="click_3">click here</a>
> > > > > > > #############
>
> > > > > > > The my jquery code looks like this:
>
> > > > > > > #############
> > > > > > > $("a[class=clicker]").click(function() {
> > > > > > > do_something(id);})
>
> > > > > > > #############
>
> > > > > > > do_something() needs the id of the button clicked. So if I clicked on
> > > > > > > the second anchor, I need "click_2" to be passed to do_something().
> > > > > > > How di I do this in jQuery?
>
> > > > > > $("a[class=clicker]").click(function() {
> > > > > > var id = this.id;
> > > > > > do_something(id);
>
> > > > > > });
No comments:
Post a Comment