1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| <!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script language="Javascript">
function activer()
{
var select = document.getElementById( "ddl" )
select.addEventListener( "change", function ( e )
{
var input = document.getElementById( "inputToDisplay" )
if ( e.target.value == "other" )
input.style.display = "inline-block"
else
input.style.display = "none"
} )
</script>
</head>
<body>
<select id="ddl" onchange="activer();">
<option value="test">TEST</option>
<option value="other">AUTRE</option>
</select>
<input type="text" name="name" id="inputToDisplay" style="display:none" />
</body>
</html> |
Partager