• Post Reply Bookmark Topic Watch Topic
  • New Topic

highlighting an iframe  RSS feed

 
Giomar Guevara
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to highlight the border of an iframe...

I'm using an onfocus method that calls this function:

function changeColor()
{
document.all.main.style.bordercolor="red";
}

however,when the iframe get the focus its bordercolor doesn't change...
the name of the iframe is "main"

Any idea?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
document.all? How quaint and proprietary! you should investigate not using browser-specific features.

What reference are you using? The style property for border color is borderColor.

Case counts.

Also, please be sure to use UBB code tags when posting code. Please read this for more info.
[ February 06, 2007: Message edited by: Bear Bibeault ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do yourself a favor and forget that document.all even exists.

Give your iframe an id and use this

document.getElementById("iframeId").style.border = "5px solid #FF0";
 
Giomar Guevara
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks...it works now...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!