<body> <fieldset id="x"><legend>longlonglong</legend></fieldset> <script> var x = document.getElementById("x"); x.insertBefore(document.createTextNode("aa"), x.firstChild); </script>