In this tutorial, I am going to utilize a button that should count clicks.
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button onclick="doGet()">Click Here</button>
<script type="text/javascript">
console.log('hey im coming');
function getSheetInfo(){
const id = 'e90uwqru90aefja1';
const ss = SpreadsheetApp.openById(id);
console.log('ss me kya aa rha hai' + ss);
}
function doGet(e){
const output = {
first : 'Laurance',
last : 'Svekis'
}
const strOutput = JSON.stringify(output);
console.log('what is coming in str output'+strOutput);
}
</script>
</body>
</html>
OutPut:


I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains:
-
DevOps School – Tech blogs and tutorials
-
Holiday Landmark – Travel stories and guides
-
Stocks Mantra – Stock market strategies and tips
-
My Medic Plus – Health and fitness guidance
-
TrueReviewNow – Honest product reviews
-
Wizbrand – SEO and digital tools for businesses
I’m also exploring the fascinating world of Quantum Computing.
[…] https://www.devopsconsulting.in/blog/call-javascript-function-on-button-click/ […]