-
Notifications
You must be signed in to change notification settings - Fork 0
jQuery.fn.blockName()
Version added: 1.0.0
Returns the name of the first block of the current set of jQuery objects. The name of the block is taken from the first CSS class.
The name of the block if there are any blocks or elements in the current set of jQuery objects; otherwise - an empty string.
Type: String
Gets the name of the block:
HTML:
<html>
<body>
<div class="product"></div>
</body>
</html>
Code:
var blockName = $('.product').blockName();
Result:
'product'
Gets the name of the element's block:
HTML:
<html>
<body>
<div class="product__name"></div>
</body>
</html>
Code:
var blockName = $('.product__name').blockName();
Result:
'product'
bem.elementSeparator
bem.modifierSeparator
bem.modifierValueSeparator
bem.block()
bem.blockModifier()
bem.element()
bem.elementModifier()
bem.getBlock()
bem.getElement()
jQuery.fn.addModifier()
jQuery.fn.blockName()
jQuery.fn.elementName()
jQuery.fn.getBlock()
jQuery.fn.getElement()
jQuery.fn.hasModifier()
jQuery.fn.isBlock()
jQuery.fn.isElement()
jQuery.fn.modifierValue()
jQuery.fn.removeModifier()