Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2014
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need to click this button, please help

    Code:
    <div class=" x-grid3-hd-inner x-grid3-hd-last_tweet_time x-component sort-desc " id="x-auto-73" role="columnheader" aria-haspopup="true" aria-owns="x-auto-73-menu" style="width: 111px; height: 16px;" aria-sort="ascending" qtip="The user's last tweet time since the last time the information was updated."><a class="x-grid3-hd-btn" style="height: 24px;" href="#"></a><span class=" x-component" id="x-auto-72">Last Tweet *</span><img class="x-grid3-sort-icon" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="></div>

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,211
    Thanks
    23
    Thanked 605 Times in 604 Posts
    <a class="x-grid3-hd-btn" style="height: 24px;" href="http://www.w3schools.com">need something here to click</a>
    <span class=" x-component" id="x-auto-72">Last Tweet *</span>
    <img class="x-grid3-sort-icon" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">
    </div>
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    New Coder
    Join Date
    Feb 2014
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I dont understand this, its the same code only you have added this line <a class="x-grid3-hd-btn" style="height: 24px;" href="http://www.w3schools.com">need something here to click</a>

    I want to create a new button using greasemonkey userscript:

    // ==UserScript==
    // @name recpi
    // @namespace name
    // @description recpi
    // @include http://tweepi.com/tools/recip#0
    // @version 1
    // @grant none
    // ==/UserScript==


    function: ......find button and click.....


    var text = document.createElement('input');
    text.setAttribute('value', 'Next page >');
    text.setAttribute('type', 'button');
    text.setAttribute('id', 'nextpagelink');
    link.appendChild(text);
    par.appendChild(link)
    document.getElementById('site').insertBefore(par,document.getElementById('main'));
    //setTimeout("document.getElementById('nextpagelink').click()",10000);
    Last edited by arclite886; 03-21-2014 at 05:59 PM.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    You got an unrelated answer because you didn't fully explain what you wanted.

    Try doing this:
    Code:
    document.querySelector('.x-grid3-hd-last_tweet_time').click();
    I'm not sure if the div id is static or dynamic. If it's static, then use this:

    Code:
    document.getElementById('x-auto-73').click();
    If not, use the class name x-grid3-hd-last_tweet_time which seems to be the identifying class for that div. If there are multiple elements with that class, then you need to use querySelectorAll and specify the index of the target element.

    Code:
    document.querySelectorAll('.x-grid3-hd-last_tweet_time')[indexOfTargetElement].click();
    If this is totally not what you're looking for, then explain a little bit more.

  • #5
    New Coder
    Join Date
    Feb 2014
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you very much it worked sorry for the not fully explained question


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •