Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>image border color</b> 2

Status
Not open for further replies.

isilkin

Technical User
Feb 12, 2008
27
US
Hi, everyone!
How do you guys change or add image border color with javascript. that is what I have now and it doesn't work.
in HTML
<td width="64"><img src="thumbnails/1.jpg" width="64" height="64" id="square0" onmouseover="borderOver();"/></td>

in Javascript
function borderOver(){
document.getElementById('square0').style.border = '#ff0000';
}
 
You're changing the colour of a border that has no size or type associated with it. Effectively setting the border to 0 pixels wide, invisible... but red.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Webflo
 
What dwarfthrower is saying is that you need to add the mission attributes:
Code:
document.getElementById('square0').style.border = '[!]1px solid[/!] #ff0000';

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
 
Indeed, but I'm more of a "7px inset" man myself.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Webflo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top