תכונות
jQuery('[attribute|=value]')
הוספה בגרסה: 1.0
attribute
שם תכונה.
value
ערך תכונה. גרשים הם אופציונליים.
תיאור: סלקטור אלמנטים, שמכילים תכונה שצוינה עם ערך ששווה לערך הנתון או מתחיל עם ערך הנתון עם מקף (-) שבא אחריו.
סלקטור זה הוכנס לתוך המפרט את ה-CSS כדי לטפל בתכונות שפה.
דוגמה
מוצא את כל הקישורים עם תכונה hreflang שהיא אנגלית.קוד מלא
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function(){ $('a[hreflang|=en]').css('border','3px dotted green'); }); </script> </head> <body> <a href="example.html" hreflang="en">Some text with hreflang="en"</a> <a href="example.html" hreflang="en-UK">Some other text with hreflang="en-UK"</a> <a href="example.html" hreflang="ru">Some other text with hreflang="ru"</a> </body> </html>
האם מידע זה היה מועיל?

