dropdown select by AJAX call. stylesheet no taking efect.

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

dropdown select by AJAX call. stylesheet no taking efect.

Post by jmut »

Hi,
I have a little problem with applying a stylesheet.
I have a style sheet something like

Code: Select all

#dropdownArea {
	height: 22px;
	display: inline;
	border: 1px solid #6B6E97;
	background-color: #FFFFFF;
	background: none;
	background-image:url(../graphix/searchback.jpg);
	background-repeat: repeat-x;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 9pt;
	color: #3B4189;
	text-decoration: none;
	padding-right: 0px;
	padding-left: 0px;
	margin-right: 8px;
}
that I apply to a dropdown menu
<select name='areaID' id='dropdownArea'>.....


I generate this dropdown menu in php....using AJAX call.
And use spanelement.innerHTML = GeneratedSelectDropdownFromAJAX

The thing is the stylesheet is not taking any efekt. Any idea how could I fix this.
I am thinking applying the stylesheet with javascript after stuffing the AJAXresponse in the spanelement.
Thanks
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

solved the problem.
Changed from id to class.

And used

Code: Select all

document.getElementById('elementID').className = 'stylesheetStyle';
Post Reply