-1

I have this paragraph that I want it to make it visible

 <p class="decriptioncontent"  id="EN_descriptionText" style="display:none;">
Alarma entre los barones: «Sánchez ya está en campaña»
</p>

with this JQUERY function

$( languageCode + "_descriptionText" ).css( "display", "visible" ); 

but it does not work !

I've tried also with

$( languageCode + "_descriptionText" ).css( "display", "block" ); 
  • 1
    `visible` isn't a valid `display` type, try `block` instead. – Hidden Hobbes Sep 01 '16 at 07:50
  • 2
    Possible duplicate of [How to change css display none or block property using Jquery?](http://stackoverflow.com/questions/3582619/how-to-change-css-display-none-or-block-property-using-jquery) – mr. Sep 01 '16 at 07:53

3 Answers3

1

You need to add # before id selector and use show() method to make it visible.

$('#' + languageCode + "_descriptionText" ).show(); 
//-^-------


Or by updating css display property.
$('#' + languageCode + "_descriptionText" ).css( "display", "block" );
//-^-------


var languageCode = 'EN';
$('#' + languageCode + "_descriptionText").show();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p class="decriptioncontent" id="EN_descriptionText" style="display:none;">
  Alarma entre los barones: «Sánchez ya está en campaña»
</p>
Pranav C Balan
  • 113,687
  • 23
  • 165
  • 188
0

Try this

$( '#' + languageCode + "_descriptionText" ).css( "display", "block" ); 
parth
  • 1,803
  • 2
  • 19
  • 27
0

You can also use this

$('#' + languageCode + "_descriptionText" ).show(); 
Sergio Sánchez Sánchez
  • 1,694
  • 3
  • 28
  • 48