为Jquery UI主题的样式动态生成内容添加类名

时间:2015-01-14 04:26:23

标签: javascript jquery html css jquery-ui

为Jquery UI主题的样式动态生成内容添加类名

我制作了一个简单的降价显示页面模板@ https://minjslib.github.io/gh-template/

我已经添加了jquery ui主题css,页面上的一些元素已经显示它正常工作。但是,有一个Article Div从网页上的Textarea接收动态生成的html。我尝试了以下

$( "Article" ).children().addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");

here is a permalink to the full source.

2 个答案:

答案 0 :(得分:2)

jQuery使用css选择器。尝试$('#Article')按ID引用元素。

答案 1 :(得分:2)

你的代码应该是这样的

$( "#Article" ).children().addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");

因为它是div的id