I have a button on my page with the following code:
<h5 onclick="flightFunction()">One Way</h5>
<script type="text/javascript">
function flightFunction() {
document.getElementById("returnDate").style.display = "none";
}
</script>
What I tried to do was just add a second document.getElementByID("rtField").style.display = "none"; (with the closure bracket) to the code, but when I click on the text, nothing happens. If I just add the code above, then one of the two elements is successfully hidden. However, I need the two elements (one using the returnDate CSS ID, the other using rtField CSS ID) both hidden at the same time when clicking the text. Is there a different code I should be using for this functionality?