JavaScript Not working in Safari and Chrome - HELP!!

Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
SpaceshipSpaceship
Watch

Ray

VIP Member
Impact
167
solved

My toggleset function does not seem to work with safari or chrome. Basically what is suppose to happen is when the user selects an option through a drop down box a div is suppose to show. It works fine with IE / FireFox / Opera just doesnt with safari or chrome. Please Help

JavaScript

Code:
<script type="text/javascript"> 

function toggleSet(rad) 
{ 
var type = rad.value;  
var list=document.getElementsByTagName('div')  
for (var k=0,elm;elm=list[k];k++)    
if (elm.className=='item')      
	elm.style.display = elm.id==type? 'inline':'';		
} 
</script>

HTML Form

HTML:
	 <select name="set1" onchange="toggleSet(this)">
	 			<option>-Select-</option>

				<option value="dom">Domain</option>
				<option value="sub">Sub Domain</option>
			</select>

DIVS
HTML:
<style>
div.item {  
display: none;  
padding: 10px;}
</style>

<div id="1" class="item" style="width:260px">stuff... 1</div>
<div id="2" class="item" style="width:260px">stuff... 2</div>


---------- Post added at 12:28 PM ---------- Previous post was at 11:44 AM ----------

Fixed:

was missing a ;

<select name="set1" onchange="toggleSet(this);">
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
CryptoExchange.com
Domain Recover

NamePros updates

Quick replies: search, your most used replies, and more on every post
Quick replies are easier to find and use now. The quick reply menu has a search box. Type a few letters to find the reply you want. A...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back