Имеется вот такой код: <!DOCTYPE html> <html> <head> <title>...</title> </head> <script type="text/javascript"> function focus() { document.getElementById("coloredElement") elem.style .borderColor = "red" } </script> <body> <input id="coloredElement" type="text" onfocus="focus()"></input> </body> </html>
Не получается сделать так, чтобы у элемента формы (input) менялся цвет при фокусировке (через Tab или при вводе текста в форму), пожалуйста, подскажите как это сделать.
<!DOCTYPE html>
<html>
<head>
<title>...</title>
</head>
<script type="text/javascript">
function focus() {
document.getElementById("coloredElement")
elem.style .borderColor = "red"
}
</script>
<body>
<input id="coloredElement" type="text" onfocus="focus()"></input>
</body>
</html>
Не получается сделать так, чтобы у элемента формы (input) менялся цвет при фокусировке (через Tab или при вводе текста в форму), пожалуйста, подскажите как это сделать.