Sets the data attribute for the tag.
Value | Use |
---|---|
null | prevents the attribute from being added to the tag |
array | adds each item in the array as an attribute value |
$data = array('name'=>'felix','animal'=>'cat');
<tag data-name="felix" data-animal="cat" {...}