Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Div class extra parameters for JQuery

Tags:

jquery

css

I have a class like this:

<div class="photo" parameter1="custom" parameter2="custom"></div>

I have 4 parameters total.

I need a way to submit this parameters inside my photo div to be used for JQuery code and still have my website W3C compliant. Any ideas?

like image 305
webmasters Avatar asked Dec 01 '22 03:12

webmasters


1 Answers

Set the doctype to HTML5 and use the custom data-* attributes.

<!DOCTYPE HTML>    
...
<div class="photo" data-parameter1="custom" data-parameter2="custom" data-parameter3="custom" data-parameter4="custom"></div>
like image 121
jimmystormig Avatar answered Dec 04 '22 00:12

jimmystormig