English 中文(简体)
A. 清晰度和恢复下降值
原标题:Jquery clear and restore dropdown values

I am wondering if it s possible to restore dropdown values once they have been cleared by jquery?

在这种例子中,你可以看到,当你检查一个检查箱时,检查箱就会失控并清除相应的下降。 检查箱一旦被封不动,价值就会消失。

在检查箱时,是否可以只清除这些数值?

http://jsfiddle.net/ZXSKH/32/"rel=“nofollow> http://jsfiddle.net/ZXSKH/32/

最佳回答

我对是否有必要提出质疑。 回答问题......

http://jsfiddle.net/ZXSKH/38/"rel=“nofollow> http://jsfiddle.net/ZXSKH/38/

问题回答

Removing the options is unnecessary since you re already disabling the selects. Simply reduce the width of the disabled selected to simulate the removal of the options:

//Remove this line
$( div[day_id="  + $(this).val() +  "] select ).find( option ).remove()

//Replace with this:
selects.css("width", "22px");

//Don t forget to restore the width when enabling the selects:
selects.css("width", "75px");

http://jsfiddle.net/ZXSKH/34/“rel=“nofollow”>a working fiddle。

为什么需要删除某些选择?

http://jsfiddle.net/ZXSKH/36/"rel=“nofollow> http://jsfiddle.net/ZXSKH/36/

u可以尝试这样做。 2. 改变这一方向

$( div[day_id=" +$(this).val()+ "] select ).find( option ).remove() 

to

$( div[day_id=" +$(this).val()+ "] select ).attr( disabled ,  ) 




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签