It should work fine, although I recommend using the $ .data () method
http://api.jquery.com/jQuery.data/
This is much safer, and jQuery ensures that data is deleted when DOM elements are deleted using jQuery methods.
Example:
<object id='myObj' data-url="http://www.stackoverflow.com" type="text/html"></object>
And you can read a value like:
var url = $('#myObj').data('url');// Read the value $('#myObj').data('url', 'some-other-value');// Set a new value
source share