Hide and display HTML element using Javascript

Advertisements

Within the JavaScript of your SAP BSP application or standard web page it is very simple to toggle a HTML element between hidden and display mode using the visibility attribute. You would just reference the elements ID and set the visibility attribute to ‘hidden’ or ‘visible’, see example below.

Advertisements


HTML Code:

<a id=”myBackButton” href=”?OnInputProcessing(goback)” class=”myButton”  >Back to Index</a>


JavaScript Code:

document.getElementById(‘myBackButton’).style.visibility = ‘hidden’;
or
document.getElementById(‘myBackButton’).style.visibility = ‘visible’;

Advertisements
Advertisements

Leave a Comment: