1

i'm trying to toggle(hide/show) an input text by radio button choice but it doesn't work.

What's wrong? http://jsfiddle.net/mwwj9vvt/ Thanks :-)

onclick="$('#idprezzoCSSClass').css('display', 'yes');"

I'm not understanding why problem is: https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js Commenting and using diffrent jquery version/resource it works, but i need ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js https://jsfiddle.net/6psb8c73/

5
  • 3
    you need to use 'display','block'..there's no such property like 'yes' Commented Mar 20, 2017 at 11:47
  • 1
    You are mixing jQuery with pure JS Commented Mar 20, 2017 at 11:47
  • and this too... Commented Mar 20, 2017 at 11:47
  • onclick="$('#idprezzoCSSClass').css('display', '');" Commented Mar 20, 2017 at 11:47
  • Using "block" instead "yes" still doesn't work :-( Commented Mar 20, 2017 at 11:55

1 Answer 1

0

Refer the code below, it might help you

<script>
$(document).ready(function(){
$("#hide").click(function(){
    $("p").hide();
});
$("#show").click(function(){
    $("p").show();
});
});
</script>

<button id="hide">Hide</button>
enter code here
Sign up to request clarification or add additional context in comments.

1 Comment

It works only if i don't add [code]<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1"> <link rel="stylesheet" href="code.jquery.com/mobile/1.0rc1/jquery.mobile-1.0rc1.min.css" /> <script type="text/javascript" src="code.jquery.com/jquery-1.6.4.min.js"></script> <script type="text/javascript" src="code.jquery.com/mobile/1.0rc1/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.