custom-data-attribute Questions

5

Solved

How can I detect with jQuery / JavaScript, if a given data-* Attribute of a certain DOM element has an empty string as a value? Common comparison operators do not seem to work properly, as the exam...
Spinner asked 25/11, 2015 at 13:17

1

I usually saw html data-attribute(s) to add specific values/parameters to html element like Bootstrap that uses them to "link" buttons to modal dialog to be opened, etc. <button type="button" c...
Clodhopping asked 15/10, 2015 at 14:50

6

Something that's been bugging me recently is the use of HTML5 data attributes and when is the appropriate to use them. Typically, on a page that performs a number of AJAX calls to my server, I req...
Lanner asked 6/4, 2011 at 0:46

5

Solved

I have a list here <ul id="demo2" data-name="demo2"> <li data-value="here">here</li> <li data-value="are">are</li> <li data-value="some...">some</li> ...
Engram asked 1/8, 2012 at 12:35

1

Solved

For example requireJS uses following syntax: <script data-main="scripts/main" src="scripts/require.js"></script> and in its documentation you can read: data-main attribute tells r...
Finkle asked 29/9, 2015 at 8:40

1

I have the following code: $nav_menu_args = array('fallback_cb' => '','menu' => 'menu', 'menu_class' => 'menu_class'); $x = wp_nav_menu( apply_filters( 'widget_nav_menu_args', $nav_menu_...
Bra asked 4/6, 2015 at 16:41

6

Solved

Custom data attributes: http://dev.w3.org/html5/spec/Overview.html#embedding-custom-non-visible-data When I say “work”, I mean, if I’ve got HTML like this: <div id="geoff" data-geoff="geoff de...

1

Solved

I have a asp checkbox in my form: <asp:CheckBox id="option" runat="server" OnCheckedChanged="checkChange" data-attributeA="somevalue1" data-attributeB="somevalue2" AutoPostBack="true" />` ...
Brahmana asked 23/2, 2015 at 10:40

2

Solved

I am parsing a JS generated webpage like so: from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdri...
Extra asked 4/2, 2015 at 16:52

11

Solved

I'm trying to select all elements that have a data-go-to attribute that is not empty. I've tried $('[data-go-to!=""]') but oddly enough it seems to be selecting every single element on the page if...
Enunciate asked 17/5, 2012 at 18:15

4

Solved

The html object: <div data-myAttribute="test"></div> The code: var $o = $("div"); $.each($o.data(),function(k,v){ console.log(k); //writes 'myattribute' instead of 'myAttribu...
Three asked 8/12, 2014 at 13:44

6

Solved

On click of one of the options I am trying to get the data value from the 'ul li a' and place it into button below, I've set up a JS fiddle example here: https://jsfiddle.net/q5j8z/4/ But cant seem...
Potable asked 5/6, 2013 at 9:23

2

Solved

I am wondering if html data attributes actually need a value to be applied? I wonder this because often all we want to know is if the attribute is actually set to act as a flag. (sure we cou...
Hokku asked 26/7, 2013 at 3:0

2

Solved

Recently I was coding away, and I ran into a weird issue. I was attempting to assign a data attribute to a new element I had created (via jQuery), only to discover it wouldn't actually assign the a...
Cycloparaffin asked 16/9, 2014 at 18:47

2

Solved

I have to do some custom sorts with Jquery Datatables. I do not want to write custom sort functions for every custom sort. I want to define a value to sort on and have Datatables ignore the origin...
Entoderm asked 29/11, 2013 at 12:44

3

I'm wondering wether I can combine data-tags with animations in CSS. I have a list of an undefined amount of items which are rendered by a javascript templating engine. As soon as the JS finished r...
Celluloid asked 26/8, 2014 at 13:11

3

Solved

width: attr(data-width); I want to know if there's any way it's possible to set a css value using HTML5's data- attribute the same way that you can set css content. Currently it doesn't wor...
Wartow asked 1/3, 2012 at 20:5

1

Solved

Given html such as : <div data-points="800">Jonh</div> <div data-points="200">Jack</div> <div data-points="1200">Julian</div> How to select elements were the ...
Dithionite asked 11/6, 2014 at 22:37

3

Solved

I have a div where dynamic data- attributes get added on some tags. (name of data- attributes to be generated dynamically by script, so there is no way my script will know the NAME of data-at...
Lately asked 5/6, 2014 at 11:41

1

Solved

I am reading some values in data attribute fields. I have seen two easy ways to read the data as shown below: var webappData = document.getElementById('web-app-data'), rating = webappData.dataset...
Gawk asked 11/5, 2014 at 19:7

4

Solved

I'm with a little problem. I've got a few buttons, each with a different data-function="" attribute. I want to execute a little script to check which of the buttons has been clicked. <a href="...
Penninite asked 17/3, 2014 at 13:21

2

Solved

I have this HTML: <section id="SSID" data-texts="'Text1', 'Text2', 'Text3'"></section> I want to create an Array variable in jQuery and my jQuery code is: $(document).ready(function...
Whitish asked 1/3, 2014 at 11:28

5

Is it possible to use data-attributes to with the JQuery Validate plugin. I currently use the class name e.g. class="{required:true, messages:{required:'You must choose a site.'}}"` but need t...
Charmer asked 26/9, 2011 at 18:25

2

Solved

Why my star is not appearing in YELLOW ? How to fix it ? Here's the relevant code for the above issue. HTML <div class="tpl" data-favorite="1"> <div> <span class="favorite">★...
Tiertza asked 23/2, 2014 at 17:44

3

Solved

I have the following HTML with data attributes - I want to write some jQuery that will loop through the HTML and collect the data attributes and put them into an array - could anyone assist as I'm ...
Stevie asked 23/1, 2014 at 11:41

© 2022 - 2024 — McMap. All rights reserved.