I am new to JQuery, this is a basic question, and I do not why the following code does not work. Please help me to figure it out.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.2.min.js">
</script>
<script>
function test()
{
var audios=$("#audio1");
alert(audios.volume); //This line does not work, it returns "undefined"
audios.volume=0.5; //This line does not work
// audios.hide(); - This works fine
}
</script>
<title>This is a test</title>
</head>
<body>
<input type="button" value="Test" onclick="test()">
<audio id="audio1" controls autoplay>
<source src="http://zz.qz828.net/06/three.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>
Have no idea why these two lines does not work:
alert(audios.volume); //This line does not work
audios.volume=0.5; //This line does not work
Thanks!