I want to use any javascript or jquery which on page load will add attribute LANG=EN to the web page. I tried using $('html').attr('name', 'value'); so still i am facing the same issue.
Asked
Active
Viewed 433 times
0
-
http://stackoverflow.com/questions/26461711/angularjs-dynamic-lang-attribute-of-html – GANI Sep 23 '16 at 19:34
-
@GANI, the question you linked has to do with AngularJS, not JS in general, as the OP is asking about. – markratledge Sep 24 '16 at 22:40
1 Answers
1
Using jQuery to change the doc type and <html>
tag is the absolutely the worst way to do what you need. jQuery rewrites the DOM, not real page source. jQuery is not intended to change such things as <html>
tags.
You need to edit the theme you are using. The <html>
is being output by your header.php
file of the theme. If you really want <html lang="en">
, edit header.php
.

Community
- 1
- 1

markratledge
- 17,322
- 12
- 60
- 106