Magento 2: How to defaultly open "content 2" tab?
Magento 2 docs - Accordion
Set active
to the tab you'd like to be open by default instead of true. For example:
$("#element").accordion({ active: "0 1"});
$("#element").accordion({ active: [0,1]});
So in your case it should be:
data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": "2", "multipleCollapsible": true}}'
Replacing 2 with the tab you require to be open.
TLDR
Change "active": true
, to "active": 1
where 1 is the tab you wish to be open by default.
On page Load Dynamically require to open some particulate tab please use below code instade of
data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": [1,4], "multipleCollapsible": true}}'
Solution
require([ 'jquery', 'accordion' ], function ($) { 'use strict'; jQuery( document ).ready(function() { jQuery( "#narrow-by-list" ).accordion({ "openedState": "active", "collapsible": true, "active": [1,4], /** Integrat Dynamic open tab */ "multipleCollapsible": true, }); }); });