# لا يمكن إضافة فئة جديدة إلى عناصر صفحة الموضوع باستخدام jQuery؟

**URL:** <https://meta.discourse.org/t/cant-add-new-class-to-topic-page-elements-using-jquery/178568>\
**Category:** Development\
**Created:** [5 فبراير 2021، 4:19م UTC](https://meta.discourse.org/t/cant-add-new-class-to-topic-page-elements-using-jquery/178568 "2021-02-05T16:19:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![cosdesign](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cosdesign/32/208585_2.png) [@cosdesign](https://meta.discourse.org/u/cosdesign)\
**Post date:** [5 فبراير 2021، 4:19م UTC](https://meta.discourse.org/t/cant-add-new-class-to-topic-page-elements-using-jquery/178568/1 "2021-02-05T16:19:35Z")

</div>

أنا أجد صعوبة في تعلم المزيد حول كيفية عمل discourse وما زلت مرتبكًا بعد [قراءة هذا](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648). أحاول إضافة عنوان ديناميكي لاسم المستخدم الخاص بالمسؤول في صفحة المنشور باستخدام jQuery لكن الأمر لا يعمل.

لكن إذا استهدفت، على سبيل المثال، وسم body وأضفت فئة (class)، فإنه يعمل.  
إذًا هل يمكن لأحد أن يشرح لي لماذا لا يعمل؟  
الكود مُدرج في تبويب الرأس (header) على أي حال.

```
<script>
  $(".names span.admin a").attr('title', 'Community Admin');
</script>

```

هل أحتاج إلى حقن هذا في منفذ إضافة (plugin outlet) أم شيء من هذا القبيل؟

---

_[View the full topic](https://meta.discourse.org/t/cant-add-new-class-to-topic-page-elements-using-jquery/178568)._
