How do I convert this small script to Prototype:
Basically 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With