Lastly, let's look at the JavaScript. As previously mentioned, shinyjs.buttonClick is a function that can access the arguments of js$buttonClick(). With that in mind, let's look at the code:
shinyjs.buttonClick = function(params) { // boilerplate code var defaultParams = { color : "black", size : "medium" }; params = shinyjs.getParams(params, defaultParams); // rest of code var elem = document.getElementById('selection'); elem.innerHTML = document.getElementById('year').value; elem.style.color = params.color; elem.style.fontSize = params.size;}
Note that it is not necessary to include the <script type="text/javascript">...</script> script tag around the JavaScript in this file. The first part is boilerplate code, and it's designed ...