I'm writing a jquery plugin that manipulates data passed to it. Is there any way of setting the data on the calling element. For example my calling method would be
$('#elementID').myplugin({formData:data})
Then within the plugin I want to do something like this
$(this).data('result','value I want to set)
$(this).data('result2','another value I want to set)
This is so I can retrieve it later to do some further processing.
I know I could just use hidden fields on the form, but thought this would be a cleaner solution.
Any suggestions?
$('#elementID').myplugin({formData:data})
Then within the plugin I want to do something like this
$(this).data('result','value I want to set)
$(this).data('result2','another value I want to set)
This is so I can retrieve it later to do some further processing.
I know I could just use hidden fields on the form, but thought this would be a cleaner solution.
Any suggestions?