Profile photo
Submitted by Mark Mazerski
on October 3rd, 2013 at 13:52:48 EST

How do I pass parameter in jQuery dialog

I have a JS function calling open jQuery dialog.But I want to pass an argument as parameter as ID of some of my data. Is it even possible to do?How please help.

Profile photo
Replied by Yogaraj Khanal
on October 4th, 2013 at 14:27:24 EST
To pass the value

$(".cssClassName").data('dataId', dataId).dialog("open");

To access the value

var dataId= $(".cssClassName").data('dataId');
Accepted Answer