<html xmlns:namespace1 xmlns:namespace2> <button onclick="alert(document.namespaces(0).name);"> Name of first namespace on the page </button> </body> </html>