jQuery change style of parent items if text value exists?
Hi Another quick jquery question. Should be a nice easy one for some of you.
I am trying to show a hidden div and it's contents if a hidden span has any text in it.
The text only appears if a placeholder has a value but remains hidden always.
If the div and contents is shown at the same time I want the content of another div to become hidden.
I've tried the below which doesn't trigger anything.
jquery
$(document).ready(function(){// Hides image and shows video if text has a value var BlogVid = $(".inner-banner div.youtube span.hide").text(); if ($(BlogVid).val() != '') { $(this).parents(".inner-banner div.youtube").css('display', 'block'); $(this).parents(".inner-banner div.absolute img").css('display', 'none');} });