<html> <body> <button onclick="getTotal();">Get total script tags</button> <script language="JavaScript"> function getTotal() { var m = document.scripts.length; alert(m); } </script> <script language="JavaScript"></script> </body> </html>