Help - Search - Members - Calendar
Full Version: Disable button with background image
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
weblogfinder
Hi,

I have a button with a class name as below:

<input type="button" class="test" value="Add" onclick=Dothis(this);>

class test
{
background-image: url("test.png");
}

I would like to disable the button when clicked
function Dothis (element)
{
element.disabled = 'true';
}

This is working fine (i'm seeing it as disabled(grayedout)) when i wont set any class. But when i set the class to "test" i'm not seeing any change. Can you please let me know how i can resolve this.
Darin McGrew
CODE
class test { ... }
This selects a test element inside a class element. Since there is no such thing as a class element or a test element, it won't select anything.

To select an element with the class="test" attribute, use
CODE
.test { ... }

See also:
http://htmlhelp.com/reference/css/structure.html
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.