Jquery, para configurar la visualización del ancho de un elemento para bloquear

I'm looking to code the jquery to set the display of an element width id "results" to block?

Not sure if it's right, sorry im new to programming, help will be appreciate, thank you.

$(document.ready(function(){
    $('results').width(display:none;);
})

preguntado el 25 de abril de 13 a las 07:04

3 Respuestas

it is not clear what you want here but assuming you want to hide the results

$(document.ready(function(){

  $('#results').css({display:"none"}); //to hide
  $('#results').css({display:"block"}); //to show
})

or you can just use hide() and show()

 $('#results').hide();
 $('#results').show();

Respondido 25 Abr '13, 07:04

if the element has an id tag with id as 'results' then

$('#results').css('display','block');

if the element has an classtag with class as 'results' then

$('.results').css('display','block');

Respondido 25 Abr '13, 07:04

not sure what you want with this line set the display of an element width id "results" ... assuming it was a typo "set the display of an element with id "results" ".

 $('#results').css('display','block');

Respondido 25 Abr '13, 07:04

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.