Pregunta

I have an html select DOM object by simply coding the raw html <select ...

I then use javascript and jQuery to change that select into a 'multiselect' object by using code like this...

$("#myselectid").multiselect();

And later on some event, I am trying to hide that multiselect with jQuery code like this...

$("#myselectid").hide()

But that does not work. Does anyone know why?

¿Fue útil?

Solución

Multiselect hides the original select and then it creates a button with the select behavior

Try

$("#myselectid").next().hide()

And it will hide that select that is created

Take a look at this page

if you do a

$("select:eq(0)")

That element is already hide but the one that you see is the next one (a button) try:

$("select:eq(0)").next()

You need to hide this one, that is the one created by multiselect

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top