Onclick event passing argument to js function
Qt WebKit
1
Posts
1
Posters
3.6k
Views
1
Watching
-
wrote on 10 Sept 2011, 12:48 last edited by
I want to be able to pass an attribute to the javascript function from the element on wick i click .
@
...
<button type=button value="MyButtonValue">
...
function someFunction(argument)
{
var elm_val = argument.target.getAttributeNS(null,'value');
myObject.setText(elm_val);
}
@myObject is the name of the object I addToJavaScriptWindowObject;
setText is a slot of that object that show a messagebox.I want argument to be the web element I click on.
Could it be done in another way?
1/1