Skip to main content
Level 2
Jan 22, 2024 12:21 PM UTC
Solved

Manipulate coral select list options

Can we override  coral-selectlist-item selected attribute of dialog box in javascript? Can not remove selected atribute from coral select options list by javascript in aem 6.5

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

TarunKumar
Community Advisor
Community Advisor
Jan 22, 2024 1:16 PM UTC

Hi @nusrat_jahan ,

You can try to create your custom JS file which will overwrite the desired attribute.

Something like below, this is just a vague logic but you may need to modify it based on your requirement

(function (document, $) { "use strict"; $(document).on("foundation-contentloaded", function () { setValue(dropDownSelector); }); function setValue(dropDownSelector) { $(dropDownSelector).each(function() { $(dropDownSelector + " coral-selectlist-item[value="+ hrefLang +"]").prop('selected', false); }); } })(document, Granite.$);

 
-Tarun

Translate
kautuk_sahni
Level 9
Jan 23, 2024 11:20 AM UTC

@nusrat_jahan Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Translate
Kautuk Sahni