I have a html element on which I should do multiple things on if condition. My present code:
<div>
<label for="myInput">Add Number</label>
<input id="myInput" type="number" required>
</div>
<script>
if (someCondition) {
$("#myInput").removeAttr("required");
$("#myInput").prop("disabled", true);
$("#myInput").val() = "";
}
</script>
My question is, is it possible to condense the jquery code? If yes then how?