【发布时间】:2021-05-23 00:23:56
【问题描述】:
我需要将“wsqmylogin”添加到现有课程中。
我尝试了以下代码,但它们都没有添加它。
请告诉我如何解决这个问题?
现有代码(由插件 YITH 创建):
<form id="yith-ywraq-default-form">
<p class="form-row " id="message_field" data-priority="">
<textarea name="message" class="input-text " id="message" placeholder=""></textarea>
</p>
</form>
我试过了:
jQuery('#yith-ywraq-default-form #message_field textarea[class="input-text"]').each(function()
{ this.setAttribute('class', 'wsqmylogin'); });
jQuery("#yith-ywraq-default-form #message_field textarea").prop("classs","wsqmylogin");
jQuery("#yith-ywraq-default-form #message_field .input-text").prop("wsqmylogin")
谢谢。
【问题讨论】:
-
在控制台上运行
jQuery('#yith-ywraq-default-form #message_field textarea[class="input-text"]').length?你找到标记了吗? -
您好:感谢您的评论。我试过了,它显示 1。你能告诉我我必须采取什么步骤吗?
-
见下面的答案:)
标签: jquery wordpress class add