<input type='text' id='q' />
<ul id='result'>
</ul>
let searchResult =['куртка','куртка женская','куртка мужская','куртка детская','куртка детская девочка']
let condition='курт'
document.getElementById('q').value = condition;
let result = document.getElementById('result')
let list=''
for(var i=0; i<searchResult.length; i++){
list += `<li> ${searchResult[i]}</li>`.replace(condition, `<b>${condition}</b>`)
}
result.innerHTML = list;
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.