Prototype: hide this script visibility check until prototype syntax?

How to convert this little script to Prototype:

Basically, I need to check if an element is visible or not, I do it using jquery as follows: $('id_element').is(':visible');but I don't know how to do this with a 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!

+3
source share
1 answer

Must be:

$('myElementID').visible();

Note that you do not use '#' to refer to an element by id, as in jQuery.

+3
source

Source: https://habr.com/ru/post/1763096/


All Articles