</style> </head> <body> <h1>Title</h1> <p title="asdf">This is a test. </p> <p>This is just a test</p> <script type="text/JavaScript"> var paras = document.getElementsByTagName("p"); for (var i=0; i< paras.length; i++) { var title_text = paras[i].getAttribute("title"); if (title_text != null) { alert(title_text); } } </script> </body> </html>