#HTML Tag depending on Prop
10 messages · Page 1 of 1 (latest)
and also for closing tag? 🙂
You can also use a variable as a tag name like <Tag> (it has to be capitalized)
smart
like: SomeTag='<section>'; if(prop) SomeTag='<div>' ; ...... <SomeTag attributes=""> .... </SomeTag>?
although I guess those tag attributes need to be set in variable
You dont need the closing brackets in the variable just the name of the tag like ‘let Tag = “div”’