Hi there,
I was trying to append an <img>
to a <noscript>
tag for a LazyLoading purpose. The fact is that everything i append to the noscript tag is showed as a text. If i replace noscript
by div
or whatever the img is showed.
Here the code used:
$img_attr = [
'src' => $src,
'srcset' => $srcset,
'sizes' => $sizes,
'alt' => $image->attr_alt(),
'title' => $image->attr_title(),
'width' => $max_width,
'height' => $max_height,
];
$img_block = brick('noscript')->addClass('img');
$img_block->append(function() use($img_attr) {
return brick('img')->attr($img_attr);
});
echo $img_block;
What the cause of this issue?
Thanks!