Qt6 topics merged with General

Onclick event passing argument to js function

  • 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 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?

Log in to reply