body タグにいくつかのクラス属性があるとします。
<body class="html logged-in frontpage no-sidebar">
...
</body>
現在、jQuery を使用して body タグのすべてのクラス属性を取得します。
$('body').attr('class');
最初/最初のクラス属性(ここでは「html」クラス)を取得したい。どのように?
body タグにいくつかのクラス属性があるとします。
<body class="html logged-in frontpage no-sidebar">
...
</body>
現在、jQuery を使用して body タグのすべてのクラス属性を取得します。
$('body').attr('class');
最初/最初のクラス属性(ここでは「html」クラス)を取得したい。どのように?