• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

dynamically move an element in Mozilla (Firefox .8) (winxp)

I am trying to move elements in a page in Firefox. I need to know the referencing syntax. Here are the basic parts of my page that  I need to get working.


function shiftThis(){                      
  document.MyID.style.left=100;   // this is the statement that I'm not sure about
}                                               // and is simply triggered by a button on the page


Note that I have position absolute stated in class style...

<STYLE><!--
  .whatever {visibility: visible;  position: absolute}  
--></STYLE>


This is the element I'm trying to move...

<div id='MyID'' class='whatever'>
<p> Hi There </p>
</div>

0
steve44
Asked:
steve44
1 Solution
 
devicCommented:
<STYLE><!--
 .whatever {visibility: visible;  position: absolute}  
--></STYLE>

<script>
function shiftThis()
{                      
      document.getElementById("MyID").style.left=100;
}                                              

</script>
<div id='MyID'' class='whatever'>
<p> Hi There </p>
</div>
<br><br>
<button onclick=shiftThis()>shiftThis</button>
0
 
steve44Author Commented:

This is exactly what i needed    THANKS!
document.getElementById("MyID")
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now