i want to change the colour of output text field when i check the check box. its working fine if instead of output i use inputext field but not working with out put text field.
this is the code snipt of jsp page
<af:panelFormLayout id="pfl3">
<af:selectBooleanCheckbox label="Noun "
id="sbc1" selected="true"/>
<af:clientListener type="click" method="changeColor"/>
<af:inputText label="test" id="it5"/>
<af:outputText value="hello " id="ota"/>
</af:panelFormLayout>
and this the jquery code
i tried all these ways but in vain
function changeColor() {
if ($("input[name=sbc1]").val() != null) {
if (($("input[name=sbc1]").is(':checked') == true )) {
$("input[name=it5]").css("color", "magenta"); // works because it5 is input field
// does not works because ota is output field
$("input[name=ota]").css("color", "orange");
$("ota").css("color", "green");
$("input[name=ota]").css("color", "magenta");
document.getElementById("ota").inlineStyle.color="blue";
$("#ota").css("color", "magenta");
$("#ota").val("something")
}
else {
$("input[name=it5]").css("color", "green");// works
//does not work
$("#ota").css("color", "green");
$("ota").css("color","red");
$("#ota").css("color","red");
document.getElementById('ota').style.color = "green";
}
}
}