{"id":13743,"date":"2021-07-10T10:56:12","date_gmt":"2021-07-10T10:56:12","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/07\/10\/innerhtml-problem\/"},"modified":"2021-07-10T10:56:12","modified_gmt":"2021-07-10T10:56:12","slug":"innerhtml-problem","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/07\/10\/innerhtml-problem\/","title":{"rendered":"innerHTML problem"},"content":{"rendered":"<p>I have a task wich i show you in the end of message. <br \/> My problem is coming from innerHTML. <br \/> Under firefox and chrome everything is OK but when i start it under IE7 and above nothing happend.<br \/> This is my code : <br \/> this is in JS file:<\/p>\n<p> function validate(param) { <\/p>\n<p> if(param.length &gt;=3) { \/\/\/\/show the parameter and check it for minimal lenght in the entry of the text field<br \/> var regex = \/^(d )-(d )$\/i; \/\/ create regular expression that we use for our purposes <br \/> \/\/var regex = \/(d )(.(d ))*(\/(d ))*-(d )$\/ ;<\/p>\n<p> var match = regex.exec(param);<br \/> if(match !== null) { \/\/check if we have a coincidence <br \/> var select = generateSelecte(match[1], match[2]); \/\/call the function with the two elemets, two numbers <br \/> if(select !== false) { \/\/if we have some result<br \/> document.getElementById(&#8220;mineSelect&#8221;). innerHTML = select; \/\/in DOM we put the checkd result<br \/> }<br \/> }<br \/> else {<br \/> alert(&#8216;The use value &#8220;&#8216; param &#8216;&#8221; is not valid&#8217;);<br \/> }<br \/> }<br \/> else {<br \/> return false;<br \/> }<br \/> }<br \/> function generateSelecte(el1 , el2) { \u00a0 \u00a0el1 = parseInt(el1);\u00a0 \u00a0el2 = parseInt(el2);\u00a0 \u00a0var DOMselect = &#8221;;\u00a0 \/\/ empty string\u00a0 \u00a0if(el1 &lt; el2) { \/\/when first number is lower we have positiv incrementation\u00a0 \u00a0 \u00a0for(var k = el1; k &lt;= el2; k ) { \u00a0 \u00a0 \u00a0 \u00a0DOMselect = DOMselect &#039;&#8217; k &#8221;; \/\/ \u043d\u0430 \u0432\u0441\u0435\u043a\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u043e\u0431\u0430\u0432\u044f\u043c\u0435 \u043d\u043e\u0432 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u043e\u043f\u0442\u0438\u043e\u043d\u0441 \u0437\u0430 \u0432\u0441\u044f\u043a\u043e \u0432\u044a\u0440\u0442\u0435\u043d\u0435 \u043d\u0430 \u0446\u0438\u043a\u044a\u043b\u0430\u00a0 \u00a0 \u00a0}\/\/on every element we add new options for every rotation in to the LOOP \u00a0 \u00a0 \u00a0return DOMselect;\u00a0 \u00a0}\u00a0 \u00a0else if(el1 &gt; el2) {\u00a0 \u00a0 \u00a0for(var k = el1; k &gt;= el2; k&#8211;) { \/\/negative, subtrac 1\u00a0 \u00a0 \u00a0 \u00a0DOMselect = DOMselect &#8221; k &#8221;;\u00a0 \u00a0 \u00a0}\u00a0 \u00a0 \u00a0return DOMselect;\u00a0 \u00a0}\u00a0 \u00a0else {\u00a0 \u00a0 \u00a0return false;\u00a0 \u00a0}}<\/p>\n<p> this is in HTML file <\/p>\n<p> <title><\/title><\/p>\n<div id=\"masterParent\">\n<div id=\"message\"><\/div>\n<p> &lt;input style=&quot;width:200px; height: 35px; line-height: 35px;<br \/> color: green; border-radius: 3px; border: 1px solid silver;&#8221; type=&#8221;text&#8221;<br \/> id=&#8221;inputText&#8221; name=&#8221;cifri&#8221; placeholder=&#8221;Please fill with mask &#8216;dd-dd'&#8221;<br \/> \/&gt;<br \/> <span id='select'><\/p>\n<p> Please fill the require field<\/p>\n<p> <\/span><br \/> <!-- When you click the button, he trigger onClick and call function 'validate' and take the result in tekst field --><br \/> &lt;input type=&quot;button&quot; name=&quot;button&quot; value=&quot;validate and set&quot;<br \/> onclick=&#8221;validate(document.getElementById(&#8216;inputText&#8217;).value)&#8221; \/&gt;<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I have a task wich i show you in the end of message. My problem is coming from innerHTML. Under firefox and chrome everything is OK but when i start it under IE7 and above nothing happend. This is my code : this is in JS file: function validate(param) { if(param.length &gt;=3) { \/\/\/\/show the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20],"class_list":["post-13743","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-programming"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/13743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=13743"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/13743\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=13743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=13743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=13743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}