Can there be more than one class added after template.js is judged according to the value in jquery?

<%=item.type==2?"class="type-radio js-type-radio type-select"" : "class="type-radio js-type-radio""%>

is it okay to have more than one class name type-radio js-type-radio type-select after such a judgment? Finally, on html, it feels like only the first class name has been added

.
Mar.12,2021

type-radio js-type-radio these two duplicates, write dead is good, judge that the extra, either add, or is "


OK
when you execute this ternary operator again, it is the environment where the template engine works, the template engine does not know the class name, it only knows that you are the value of a string with spaces, so there is no problem.

<%=item.type==2?'class="type-radio js-type-radio type-select"' : 'class="type-radio js-type-radio"'%>

your line of code is an evaluation expression. Eventually, a string such as
type = = 2 = = > class= "type-radio js-type-radio type-select"
type! = 2 = > class= "type-radio js-type-radio"
can be parsed by the browser

as an attribute of the tag.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46cff-44bf2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46cff-44bf2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?