Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <body> <a id="w3s" charset="ISO-8859-1" href="../default.htm">W3Schools</a><br> <script> document.write("Return charset of link: "); document.write(document.getElementById('w3s').charset); document.write("<br><br>"); </script> <a id="google" href="../../www.google.com/default.htm">Google</a><br> <script> document.getElementById('google').charset="utf-8"; document.write("Set charset of link to: "); document.write(document.getElementById('google').charset); </script> </body> </html>
Result:
W3Schools.com - Try it yourself