how to get the first element of an array which passed to smarty template page, and treat it some way in smarty page.
i use this way but it's not working.
$("item_".{$categories.category_id[1]}).addClass("active");
how to get the first element of an array which passed to smarty template page, and treat it some way in smarty page.
i use this way but it's not working.
$("item_".{$categories.category_id[1]}).addClass("active");
try with concatenating strings with the + operator
For example:
var myId = "domElement";
$("#"+myId).addClass("active");
This should work:
Result:
$("item_{$categories.category_id.1}").addClass("active");