Jump to content

Z-Index issues


lcmorley

Recommended Posts

I am trying to create a multi select drop down list using html components.I have two textboxes and a button beside each.Is it possible on click of the first button to have the "select" element just sit on top of the second text box. Rather than pushing further down the page?Here is the code:

<head>	<script type="text/javascript">		function onButtonClick(invokingButton,list) {			var listArray = list.split(',');				var listBox = document.createElement('select');					listBox.setAttribute('multiple', 'true');													listBox.style.cssText = 'position:relative;z-index:1;';			document.getElementById("span").appendChild(listBox);					}		</script></head><body>	<div>		<input type="text"/> 		<input type="button" onClick="onButtonClick(this, 'Active, Deferred')"/>		<div>			<span id="span"></span>		</div>				</div>	<div>		<input type="text"/> 		<input type="button" onClick="onButtonClick(this, 'Active, Deferred')"/>			<div>			<span id="span"></span>		</div>				</div></body>

Any help would be greatly appreciated as I have spent far too long on this now. :)Thanks.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...