Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9004569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:55:33+00:00 2026-06-16T00:55:33+00:00

I have the following img tag, <img id=image1 src=URL alt=image1 name=image1 width=137 height=119 border=0

  • 0

I have the following img tag,

 <img id="image1" src="URL" alt="image1" name="image1" width="137" height="119" border="0" style="position: relative; left: -355px; top: 62px;" >

I would like to somehow, onclick, store the following items into seperate variables..

  style="position: relative; left: -355px; top: 62px;"

  var left = -355px
  var top = 62px

Is that possible? Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:55:34+00:00Added an answer on June 16, 2026 at 12:55 am

    Of course this is possible, have you tried something like this:

    $('#image1').on('click', function () {
        var style = 'style="' + $(this).attr('style') + '"';
        var left = $(this).css('left');
        var top = $(this).css('top');
    
        alert(style);
        alert(left);
        alert(top);
    });
    

    Example: http://jsfiddle.net/9ZXHX/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML... <img id=image1 src=URL alt=image1 name=image1 width=137 height=119 border=0 style=position:
Assume I have the following string: Hellotoevryone<img height=115 width=150 alt= src=/Content/Edt/image/b4976875-8dfb-444c-8b32-cc b47b2d81e0.jpg />Iamsogladtoseeall. This
I have the following tracking pixel: <img id=pixel alt= width=1 height=1 src=https://domain.com/file.cfm?amount={tag_amount}&amp;tracking={tag_invoicenumber}&amp;transtype=sale&amp;merchantID=29562 /> I
I have the following image tag in a JSP: <img id=validationGraph src=/myapp/MyServlet?mode=myMode usemap=#validationMap border=0
I have following HTML markup, <div id=subcontent_l> <p> <a href=/membership-packages/><img height=202 width=644 alt= src=http://74.52.72.231/wp-content/uploads/2010/06/banner1.jpg
I have the following image tag on a page: <img src=http://photo.com/img/p806792255-6.jpg id=will6-1 alt=will6-1 title=will6-1
I have following HTML <tr id=r1 class=l1> <td><img class=plusminus id=r1c1 src=assets/images/plus.png border=0 />3/10/12</td> <td></td>
I have the following markup: <p class=managebox> <button value=Add page> <img src=page_add.png alt=Add more
I have the following HTML Tags: <input id="bigPicture" name="bigPicture" type="file" value=""> <img src="test.png" id="test1">
I have the following string... Overall: 21 (1,192,742<img src=/images/image/move_up.gif title=+7195865 alt=Up />)<br /> August:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.