代码编辑器:
x
1
2
<meta charset="utf-8">
3
<link href="/static/next/css/tryit.css?v=2017082407" rel="stylesheet"/>
4
<script>
5
function ChangeOpacity(x)
6
{
7
// Return the text of the selected option
8
var opacity=x.options[x.selectedIndex].text;
9
var el=document.getElementById("p1");
10
if (el.style.opacity!==undefined)
11
{el.style.opacity=opacity;}
12
else
13
{alert("Your browser doesn't support this example!");}
14
}
15
</script>
16
<p id="p1">Select a value from the list below, to change this element's opacity!</p>
17
<select onchange="ChangeOpacity(this);" size="5">
18
<option />0