我想在单击按钮时将标签的颜色更改为红色
但是代码不起作用一切似乎都是正确的
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
</title>
<script type="text/javascript">
function changeColor(id, newColor) {
var labelObject = document.getElementById(id);
$("#" + id).css("color", newColor);
}
</script>
</head><body>
<form id="frm2">
<label for="model">Male</label>
<input type="text" name="cars" id="model" />
<br />
<label for="female">Female</label>
<input type="text" name="cars" id="color" />
</form>
<input type="button" value="Change Label Color" onclick="return changeColor('label', 'red')" />
</body>
</html>
请帮忙