开发者

Prototype: Covert this visibility checking script to prototype syntax?

开发者 https://www.devze.com 2023-01-15 05:28 出处:网络
How do I convert this small script to Prototype: Basi开发者_运维百科cally I need to check if an element is visible or not, I do with jquery this way: $(\'id_element\').is(\':visible\'); but I dont kn

How do I convert this small script to Prototype:

Basi开发者_运维百科cally I need to check if an element is visible or not, I do with jquery this way: $('id_element').is(':visible'); but I dont know how to do it similar with Prototype.

<div id="myDiv" style="display:none">A Div</div>
<script>
if(document.getElementById('myDiv').style.display == 'none') alert('visible');
else alert('hidden');
</script>

Thank you!


Should be:

$('myElementID').visible();

Note that you do not use '#' to reference the element by id like you do in jQuery.

0

精彩评论

暂无评论...
验证码 换一张
取 消