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 7 of 7
  1. #1
    New Coder
    Join Date
    Feb 2014
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need to click a button

    need to click this button

    Code:
    <div tabindex="0" class="x-button-litebutton-wrapper x-btn action_button inline_block x-component x-btn-text-icon " id="x-auto-149" aria-describedby="x-auto-82" style="width: 40px;">Follow<img class=" x-btn-image" role="presentation" style='background: url("http://tweepi.com/js/tweepigxt/67791A54F68E6C387B9AEF4E96FFB252.cache.png") no-repeat -162px 0px; left: -1px; top: 3px; width: 16px; height: 16px; position: absolute;' onload='this.__gwtLastUnhandledEvent="load";' src="http://tweepi.com/js/tweepigxt/clear.cache.gif"
     border="0"></div>
    please help

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,092
    Thanks
    23
    Thanked 594 Times in 593 Posts
    This is not a button. It's a div that contains an image.
    Try this:
    Code:
    <div tabindex="0"
    class="x-button-litebutton-wrapper x-btn action_button inline_block x-component x-btn-text-icon "
    id="x-auto-149" aria-describedby="x-auto-82"
    style="width: 40px;border:1px solid red;" onclick="alert('here');" >Follow
    
    <img class=" x-btn-image"
    role="presentation"
    style='background: url("http://tweepi.com/js/tweepigxt/67791A54F68E6C387B9AEF4E96FFB252.cache.png") no-repeat -162px 0px; left: -1px; top: 3px; width: 16px; height: 16px; position: absolute;'
    onload='this.__gwtLastUnhandledEvent="load";'
    src="http://tweepi.com/js/tweepigxt/clear.cache.gif"
    border="0">
    </div>
    I add whats in red.
    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
    So how do I need to click this div, just copy the whole code and add "onclick="alert('here')" ?

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,918
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Just use the code sunfighter has given you.

    In place of "onclick="alert('here')" use onclick = call the event required - you did not tell us what you wish to happen when the image is clicked.

    I would make it style="width: 50px;
    Last edited by Philip M; 03-04-2014 at 08:02 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    New Coder
    Join Date
    Feb 2014
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also need to click multiple div / images about 20 of them on the same page how can I do that
    this is one the other div / images

    <div class="x-button-litebutton-wrapper x-btn action_button inline_block x-component x-btn-text-icon " aria-describedby="x-auto-614" id="x-auto-637" tabindex="0" style="width: 40px;">Follow<img onload="this.__gwtLastUnhandledEvent=&quot;load&quot;;" src="http://tweepi.com/js/tweepigxt/clear.cache.gif" style="width: 16px; height: 16px; background-image: url(http://tweepi.com/js/tweepigxt/67791...52.cache.png); position: absolute; left: -1px; top: 3px; background-position: -162px 0px; background-repeat: no-repeat no-repeat;" border="0" role="presentation" class=" x-btn-image"></div>

  • #6
    New Coder
    Join Date
    Feb 2014
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also need to click multiple div / images about 20 of them on the same page how can I do that
    this is one the other div / images

    <div class="x-button-litebutton-wrapper x-btn action_button inline_block x-component x-btn-text-icon " aria-describedby="x-auto-614" id="x-auto-637" tabindex="0" style="width: 40px;">Follow<img onload="this.__gwtLastUnhandledEvent=&quot;load&quot;;" src="http://tweepi.com/js/tweepigxt/clear.cache.gif" style="width: 16px; height: 16px; background-image: url(http://tweepi.com/js/tweepigxt/67791...52.cache.png); position: absolute; left: -1px; top: 3px; background-position: -162px 0px; background-repeat: no-repeat no-repeat;" border="0" role="presentation" class=" x-btn-image"></div>

  • #7
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,092
    Thanks
    23
    Thanked 594 Times in 593 Posts
    You add ONCLICK="CALL YOUR FUNCTION HERE" and a width to each inclosing div as I showed you. No need to put the border around it. That was to show you what the width property did for you.
    Last edited by sunfighter; 03-04-2014 at 02:10 PM.
    Evolution - The non-random survival of random variants.

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


  •  

    LinkBacks (?)

    1. 03-02-2014, 06:05 PM

    Posting Permissions

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