Remove the quote
on '/'
=> '/
pop_str = pop_str + '<a href="'+ brand1 + 'vs' + brand2 + '"/><button class="btn master_btn">Compare Now!<button></a>';
Remove the quote
on '/'
=> '/
pop_str = pop_str + '<a href="'+ brand1 + 'vs' + brand2 + '"/><button class="btn master_btn">Compare Now!<button></a>';
To simplify this you could use the back tick character `
:
pop_str = `${pop_str}<a href="${brand1}vs${brand2}"><button class="btn master_btn">Compare Now!<button></a>`
You simply place your variables within ${variable}
I write this javascript but it’s showing error. can anyone solve this how to write it correctly?
actually I want to show button and on the button, I want link
pop_str = pop_str + '<a href="'+ brand1 + 'vs' + brand2 + '/'><button class="btn master_btn">Compare Now!<button></a>';
what is the error and what you want to achieve?
i think this answer would help you !!!
Please note it is invalid to have interactive content (e.g. a
actually it shows whole tag in link?
yes of course .They will parse the string and variable
not but that’s not a solution that I want! on the button I want the link
for your question
Right after a posted this someone showed a similar answer lol. But they’re correct, using the back tick can be more efficient in this situation.
no, when I click on button then there is no link in your solution!