Linked Questions

13 votes
1 answer
29k views

Select td based on data attribute [duplicate]

Possible Duplicate: Jquery selectors on custom data attributes on HTML5 How can I select all td with html data attribute equal to some value? E.G. Fiddle $("td").dblclick(function (e) { ...
P.Brian.Mackey's user avatar
2 votes
1 answer
3k views

How to target specific attribute with a certain value in jQuery? [duplicate]

The problem I am trying to solve is this: Write the function newMessage, which receives the name of the topic as the parameter. Function should change the background-color of the p tag to red where ...
JoyFulCode's user avatar
-1 votes
3 answers
3k views

How to get the value of select tag with certain class and data attribute? [duplicate]

<div id='participant-detail'> <select class="form-control quantity" data-short-name="8"> </select> <select class="form-control quantity" data-short-name="6">...
MDB's user avatar
  • 360
-1 votes
2 answers
89 views

How can i use jquery to find an item by a different attribute than class? [duplicate]

I have the following html on a page: <span class="descriptionLink" projectid="14180"> Some text </span> <span class="descriptionLink" projectid="14181"> ...
leora's user avatar
  • 198k
1209 votes
11 answers
1.3m views

Selecting element by data attribute with jQuery

Is there an easy and straight-forward method to select elements based on their data attribute? For example, select all anchors that has data attribute named customerID which has value of 22. I am ...
Hazem Salama's user avatar
  • 15.2k
136 votes
5 answers
136k views

Filter element based on .data() key/value

Say I have 4 div elements with class .navlink, which, when clicked, use .data() to set a key called 'selected', to a value of true: $('.navlink')click(function() { $(this).data('selected', true); }) ...
user113716's user avatar
  • 323k
131 votes
7 answers
134k views

Unable to set data attribute using jQuery Data() API

I've got the following field on an MVC view: @Html.TextBoxFor(model => model.Course.Title, new { data_helptext = "Old Text" })</span> In a seperate js file, I want to set the data-helptext ...
Jason Evans's user avatar
  • 29.2k
1 vote
5 answers
14k views

How to select previous element in jquery?

i have an image and i would like to assign which element of the area is clickable. The red stripe shouldn't be clickable. My HTML solution: <img src="" data-highres="" usemap=&...
Greg Ostry's user avatar
  • 1,231
5 votes
2 answers
3k views

Best practice to store array of values in html attr?

What is the best practice to store an array of values in a html (from php) attribute and later access them from javascript/jQuery? <div class="storage" someAttr=?? /></div> Its basically ...
Dainius Vaičiulis's user avatar
-1 votes
3 answers
5k views

jQuery selectors on custom data attribute that are not empty

I want to create a simple custom tooltip plugin for jQuery that for every element that has a data-custom-tooltipset. So, something like : <a href= . . . " data-custom-tooltip="This is my tooltip ...
JanvierDesigns's user avatar
1 vote
2 answers
2k views

Search div using data attribute value

Search elements based on data attributes. I have the following code and would like to know, how can this be achieved if the data attribute value with space <div class="data" data-value="auto"> ...
Raju28's user avatar
  • 335
2 votes
1 answer
522 views

jQuery attribute equals selector not working for custom attribute

Hi am attempting to fire off some jQuery on the click event of a div. I am attempting to target the element via jQuery's attribute equals selector, but I have not had any luck so far. I've used this ...
EricBellDesigns's user avatar
0 votes
1 answer
759 views

jQuery: find elements where data attribute is has a specific value

I have a master checkbox Select all along with a button to revert back to their original state to which there were loaded with. After the page is loaded I bind a data property to each of the ...
Mr.Singh's user avatar
  • 2,035
0 votes
2 answers
218 views

How to wrap elements only if attributes match with jQuery?

So I have this code: $('.brandModelWrapperGroup').each(function(){ var group = $(this).attr('data-model-group') var brandModelwrapperdivs = $(this).find(".brandModelWrapper") for(var i = 0; i &...
Xeen's user avatar
  • 7,023
1 vote
1 answer
125 views

How to fetch a div content based on a inner value contained in it?

On Click on the plus icon it will increase the quantity of the corresponding Item and updates that to the MyOrders tab div . Now on clcik of the Myorders tab div , how can i extract the ...
user avatar

15 30 50 per page