Answer the question
In order to leave comments, you need to log in
How to replace time in template string?
Good day.
Tell me how to get the result "We drove in at 13:00, left at 15:00" (replace the time in the line)?
Replace "10:00" with time.checkin (13:00 for example) and "19:00" with time.checkout (for example 15:00)
The part of the template where you want to replace the time:
<p class="popup__text popup_time">Заехали в 10:00, выехали в 19:00</p>
<p class="popup__text popup_price">5200 <span>₽/ночь</span></p>
const price = advertElement.querySelector('.popup_price');
price.textContent = price.textContent.replace('5200', advert.price).
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question