echo "<li class='product-results-item' article-name=" . $product->article_name . ">" . $product->article_name . "</li>";
When echoing this line, the article-name attribute gets cut off, meaning that Single Bed becomes Single.This does not happen for the article_name text between the <li>
tags
How can I overcome this problem?
Advertisement
Answer
There are missing (single) quotes around attribute value.
echo "<li class='product-results-item' article-name='" . $product->article_name . "'>". $product->article_name. "</li>"; ^ ^