0
Bold and Unbold
Okay so how do i make it so when my button is clicked it says unbold i tried in javascript using elementbyid and making the string to “Unbold” but it didnt work any help? https://code.sololearn.com/WcheSYQXQntj/?ref=app
5 Respostas
+ 1
+ In HTML:
<button type="button" onclick="text.classList.toggle('bold');">Bold</button>
<button type="button" onclick="text.classList.toggle('upperCase');">Upper/Lower</button>
<input type="text" id="text"> <!-- </p> without a pairing <p> ... </p>-->
+ In CSS:
.bold {
font-weight: bold;
}
.upperCase
{
text-transform: uppercase;
}
Delete all code in JS tab.
0
It doesnt work
0
Okay so where is the syntax error?
https://code.sololearn.com/WGZes8iMS9TX/?ref=app
0
Okay so Ipang why is my charcter count not working?
https://code.sololearn.com/WfVYcf88U2b5/?ref=app
0
Get the input 'value' attribute.
let txt = document.getElementById("text").value;