Manipulate coral select list options | Community
Skip to main content
Level 2
January 22, 2024
Solved

Manipulate coral select list options

  • January 22, 2024
  • 3 replies
  • 879 views

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
January 22, 2024

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

kautuk_sahni
Community Manager
Community Manager
January 23, 2024

@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.

Kautuk Sahni