0

I have spent way to much time on this and now I need help (days in fact). The HTML is as follows:

<div class="row">
      <div class='five mobile-four columns'>
        <label class='right inline'>
          Ciudad/Estado
        </label>
      </div>
</div>

The code is as follows:

(function ($) {
    $('div:contains("Ciudad/Estado")').css('display', 'none');
    $("#field_2762").change(function () {
        if ($(this).val() == 'Seleccione') {
            $("div:contains('Ciudad/Estado')").css('display', 'none');
        }
        if ($(this).val() == 'Puerto Rico') {
            $("div:contains('Ciudad/Estado')").css('display', 'block');
        }
    });
});

Basically I want the select the parent div with a very common .row class so I can hide it and show it dependent on a dropdown. So far the variations of code I have tried (in the thousands) have not worked.

I am new to StackExchange so please feel free to be kind.

RexS117
  • 11
  • 1
  • (function ($) { -> should be '$(function(){' -> http://stackoverflow.com/questions/6004129/document-ready-shorthand Change it, and code will work, i guess... – sinisake Mar 28 '15 at 18:41
  • @nevermind Thanks for the quick response but no effect on the changes. Any other ideas? – RexS117 Mar 28 '15 at 19:52
  • Code is working - not sure what is problem. http://jsfiddle.net/1wnn4naL/ Did you included jquery? – sinisake Mar 28 '15 at 20:01
  • @nevermind I also had used jsfiddle and worked perfectly. Yes jQuery is included and started. No errors on Firefox or Chrome. – RexS117 Mar 28 '15 at 20:10

0 Answers0