As title,I cannot get DOM attrbute by jQuery.attr()
But can get attrbute by document.attrbute
. How to solve It?
console.log($("#video01").attr('readyState'));
console.log($("#video01")[0].readyState);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<video id='video01' src="http://cloud.video.taobao.com/play/u/2554695624/p/1/e/6/t/1/fv/102/28552077.mp4" autoplay=""></video>
You have to use prop
insted attr
console.log($("#video01").prop('readyState'));
console.log($("#video01")[0].readyState);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<video id='video01' src="http://cloud.video.taobao.com/play/u/2554695624/p/1/e/6/t/1/fv/102/28552077.mp4" autoplay=""></video>