custom-data-attribute

Selecting element by data attribute

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 kind of hesitant to use rel or other attributes to store such information, but I find it much harder to select an element based on what data ...

How to use HTML-5 data-* attributes in ASP.NET MVC

I am trying to use HTML5 data- attributes in my ASP.NET MVC 1 project. (I am a C# and ASP.NET MVC newbie.) <%= Html.ActionLink("« Previous", "Search", new { keyword = Model.Keyword, page = Model.currPage - 1}, new { @class = "prev", data-details = "Some Details" })%> The "data-details" in the above htmlAttributes give the...

HTML5 Data Attributes for XHTML

Does anyone know how the HTML5 data attributes (data-*) can be implemented in XHTML without rendering the markup as invalid? Is there a custom namespacing hack that would allow this on existing HTML elements? ...

Rails 3 UJS and XHTML

I have a simple question about how Rails 3 works with XHTML doctypes. Since Rails 3 uses UJS for its ajax calls (and even normal calls such as delete calls) and does so by use of HTML5 data attributes, then, since XHTML doesn't support data attributes, will the markup be automatically invalid? ...

Is there any problem with using HTML5's "data-*" attributes for older browsers?

I want to associate some custom data with some HTML nodes. I was going to use the new HTML5 style 'data-*' attributes. e.g.: <tr class="foo" data-typeid="7">…, and then I was going to select this HTML node and show/hide it etc. by reading the value with $(node).attr("data-typeid"). However this web page needs to work with older browsers...