Jump to content

select not work and why?


Yohanne

Recommended Posts

Hi

 

What is the wrong with this code?

!DOCTYPE html>

<head>

	<script type="text/javascript">
			$('#mylist').change(function(){
    if( $(this).val() == '3'){
        $('body').append('<input id="myInput" type="text" value = "wwwwwwwww"/>');
    }else{
        $('#myInput').remove();
    }
});
	
	</script>
	
	
</head>
<body>
		<select id="mylist">
			<option selected></option>
			<option value="1" >aaaa</option>
			 <option value="2">bbb</option>
			<option value="3">ccc</option>
		</select>
</body>
</html>
Link to comment
https://forums.phpfreaks.com/topic/289280-select-not-work-and-why/
Share on other sites

Okay, sorry..

 

 

and here is. i have a select box to identify input type. under selection there are 1,2 and 3 values that there are different function, that i need to show upon selecting. the code avobe is not working, i mean is, when i selecting each value in option box, there is nothing happen.

 

i want to show value "wwwwwwwww", after selecting value 3.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.