I read, with great interest, about using a button to show and hide text here. However, I have several blocks of text for which I would like a button to toggle show/hide but would prefer not to duplicate the same function several times. I would like to pass the div ID as a parameter so that multiple buttons may use the same function to show/hide the text associated with each button. I tried the following code but it does not work.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#myDIV {