29 votes
0 answers
javascript - How to add styling to element with liquid schema settings?
Solution:
This should work and without unecessary JS:
<p class="eventDate{% if section.settings.eventOver %} eventOver{% endif %}">
{{ section.settings.date_picker | date: "%d-%m-%Y" }}
</p>
<style>
.eventOver {text-decoration:line-through;}
</style>
Please note about your JS code that it ain't be more than one unique ID per document which probably explains your issue.
Undefined asked
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.