Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Onclick event passing argument to js function
Forum Updated to NodeBB v4.3 + New Features

Onclick event passing argument to js function

Scheduled Pinned Locked Moved Qt WebKit
1 Posts 1 Posters 3.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    claud84
    wrote on 10 Sept 2011, 12:48 last edited by
    #1

    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 Reply Last reply
    0

    1/1

    10 Sept 2011, 12:48

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved