proggR Posted November 28, 2010 Share Posted November 28, 2010 I'm sure this is a fairly rudimentary question and I have done it before in the past but I can't seem to recall how nor find it anywhere online. I have right now something that looks like this in HTML: <a href="#" class = "up">UP</a><span class="score" id="score_2">5</span> points. The anchor tag is a bit redundant and I am likely going to remove it and just throw span tags around it. I have a bit of jquery that says when anything with the class "up" gets clicked to send a request to a php script and update the score with the results. The only thing is that right now its all hard coded as far as what score will be updated because I can't remember how to get the event information. Basically I need to be able to view the id of what was clicked, even though the click event is triggered based on the class. Can anyone help? I'm sure it has something to do with "this" but I can't recall what exactly. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/220066-jquery-get-event-information/ Share on other sites More sharing options...
proggR Posted November 28, 2010 Author Share Posted November 28, 2010 It was this.id.... I don't know how I forgot that. Sorry about that Quote Link to comment https://forums.phpfreaks.com/topic/220066-jquery-get-event-information/#findComment-1140605 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.