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 8124673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:32:10+00:00 2026-06-06T06:32:10+00:00

If I have some HTML like this: <a onmouseover=’SetTopLeft(this);’href=’#’>Click me!</a> Can I get both

  • 0

If I have some HTML like this:

<a onmouseover='SetTopLeft(this);'href='#'>Click me!</a>

Can I get both the object AND the event in the function? So, for example, can I have a method signature like this?

function SetTopLeft(e, o)

…where e is the event and o is ‘this’? I may actually not need the object, but I think I probably DO need the event. I wouldn’t mind understanding a little better how this works in JavaScript – i.e., when/how can I pass an event and when/how can I pass the calling object? Can I choose which to pass? Can I pass both?

Basically, what I really need to do is get the mouse coordinates within the DIV within which the anchor is located (even if that DIV is only a portion of a web page and whether or not the browser is full-screen) and I’m having a terrible time getting it done. Most of the examples I have seen for getting these coordinates within some element use the event and the pageX and pageY properties of that event.

By the way, this must work in IE 6 onward. Firefox would be good, too. Others are not necessary.

  • 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-06T06:32:13+00:00Added an answer on June 6, 2026 at 6:32 am

    Yes, in the inline code this refers to the HTML DOM object for the element, and event refers to the event object. So you could do the following:

    HTML

    <a onmouseover='SetTopLeft(event, this);' href='#'>Click me!</a>
    

    JavaScript

    function SetTopLeft(e, obj) {...}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some HTML that looks like this: <div> <div class=value> <a href=# class=clicker>Some
I have some HTML like this: <h4 class=box_header clearfix> <span> <a rel=dialog href=http://www.google.com/?q=word>Search</a> </span>
If I have some html like this. <ul class=menu> <li> <a href=pageGreen> pageGreen </a>
I have some HTML stuff like this <div id='divItemHolder'onMouseout='HideEditDiv()' onMouseover='ShowEditDiv()><div id='itemName'></div><div id='divEdit'></div></div> and in
I have some html code like this. <a href=http://www.google.com.pk id=goog title=<table width='20%' border='1'> <tr>
I have some HTML setup like this: <div> <label for=amount><a id=amount-help-icon class=help icon-link href=#><span
I have some HTML like this: <div id=MyDiv> <div class=Class1> <div class=SClass1></div> </div> <div
I have some HTML like this: <input type=radio class=MyRadio name=TheName> <label for=TheLabel>the text</label> How
I have a problem where I have some html like this <p>There is the
I'm experimenting playing video in a UIWebView. If I have some html like this:

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.