Jump to content

vmars316

Members
  • Content Count

    368
  • Joined

  • Last visited

Everything posted by vmars316

  1. Thanks , That 'SavePageAs' is working fine now . If I hit the enter-key all looks well until I save the page . The 'saved page' shows that for each time the I hit the enter-key , a '<div>plus text</div> 'is created . See below: </div> <!-- <div class="Cell" --> <div id="Row2Cell2"> <p contenteditable="" id="p_ah">Article Heading</p> <p contenteditable="" id="p_tgh">Text Paragraph</p> <p contenteditable="true" id="p_tgh">Text Areadfghhjdfjj<div>sfhh</div><div>jbnn</div></p><p contenteditable="true" id="p_tgh">Text Area<div>adghh</div><div>adggg</div><div><br></div><div>asfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div></p></div> I think I can intercept and cancel the enter-key press . So that instead of creating a new <div> I would like to 'insert' a few spaces . So I will be working on that . I 'm also having a problem with getting body { font-family:Sans-serif; margin: 0 auto; padding:0; border: 0; height: 100%; } html { height: 100%; margin: 0 auto; padding:0; border: 0; } 'height: 100%;' to work . I want to fill up the whole page . Is there a quick fix for that or should I open up a new Post ? Thanks Here is the working code (for Chrome) for ''Save This Page' : <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3-Rows-3-Cols.html</title> <!-- file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/3-Rows-3-Cols-SaveAs.html https://www.dummies.com/web-design-development/css3/using-the-div-tag-to-create-tables/ https://www.freeformatter.com/html-validator.html <a href="https://developer.mozilla.org/en-US/" target="_blank"> <img src="https://mdn.mozillademos.org/files/6851/mdn_logo.png"alt="MDN logo" /> </a> --> <style type="text/css"> body { font-family:Sans-serif; margin: 0 auto; padding:0; border: 0; height: 100%; } html { height: 100%; margin: 0 auto; padding:0; border: 0; } #wholePageWrapper { height: 100%; margin: 0 auto; padding:0; } .Table { height: 100%; text-align: center; vertical-align: top; margin: 0 auto; padding:0; } #mainHeading { text-align: center; width: 100%; background: #BCCE98; vertical-align: top; margin: 0 auto; padding:0; } #container { padding-bottom: 1001em; margin-bottom: -1000em; overflow: hidden; margin: 0 auto; padding:0; } #Row1 { display: block; width: 100%; vertical-align: top; margin: 0 auto; padding:0; } #Row2 { display: block; width: 100%; margin: 0 auto; padding:0; } #Row3 { width: 100%; margin: 0 auto; padding:0; vertical-align: top; display: inline; } #Row1Cell1 { color: #4C4C4C; display: inline-block; text-align: center; width: 100%; font-size: 18px } #Row2Cell1 { display: inline-block; background-color: #DAE9BC; width: 20%; margin: 0 auto; float: left; padding-bottom: 1001em; margin-bottom: -1000em; } #Row2Cell2 { display: inline-block; text-align: center; width: 60%; background-color:#F8F8FF; margin: 0 auto; float:left; padding-bottom: 1001em; margin-bottom: -1000em; } #Row2Cell3 { display: inline-block; width: 20%; background: #e9f2d7; margin: 0 auto; float: right; padding-bottom: 1001em; margin-bottom: -1000em; } #Row3Cell1 { display: inline-block; width: 100%; background: #BCCE98; margin: 0 auto; overflow: auto; text-align: center; } div{ text-align: left; font-size: 14px } #p_bn { text-align: left; } #p_ah { color: #4C4C4C; /* color: #555555; */ text-align: left; font-size: 16px } #p_tgh { /* color: #999999; */ color: #4C4C4C; text-align: left; font-size: 14px } #currentPage_Address { color:#e9f2d7; } </style> </head> <body onload="documentURL()"><!-- Run me 1st --> <div class="Table"> <!-- ============NewRow============== --> <div id="Row1"> <div id="Row1Cell1"> <p contenteditable="true"; id="mainHeading"> myMainHeading</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> <!-- ============NewRow============== --> <div id="container"> <div id="Row2"> <div id="Row2Cell1"> <p contenteditable="" style="color:#5886BC;">notes</p> </div> <!-- <div class="Cell" --> <div id="Row2Cell2"> <p contenteditable="" id="p_ah">Article Heading</p> <p contenteditable="" id="p_tgh">Text Area</p> </div> <!-- <div class="Cell" --> <div id="Row2Cell3"> <p contenteditable="true"; style="color:#576C15">notes</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> </div> <!-- id="container" --> <!-- ============NewRow============== --> <div id="Row3"> <div id="Row3Cell1"> <button onclick="createArticleHeading()">Add Article Heading</button> <button onclick="createTextArea()">Add Text Area</button> <form action="http://google.com" target="_blank" style="display: inline;"> <input type="submit" value="Search Google" /> </form> <button onclick="saveAs(filename, allHtml)">Save This Page</button> <p id="currentPage_Address" > </p> </div> <!-- id="Row3Cell1" --> </div> <!-- <div class="Row" --> </div> <!-- <div class="Table"> --> <script> var ArticleHeading = "Article Heading"; var TextParagraph = "Text Area"; var ButtonParagraph = "New Link"; var document_URL; const filename = "MyStory.html"; var allHtml = document.documentElement.outerHTML; var document_URL; function documentURL() { document_URL = document.URL; document.getElementById("currentPage_Address").innerHTML = document_URL; } </script> <script contenteditable=""> function createTextArea() { var p_tgh = document.createElement("p"); p_tgh.innerHTML = TextParagraph; p_tgh.setAttribute("contenteditable", "true"); p_tgh.setAttribute("id","p_tgh"); var content = document.getElementById("Row2Cell2"); content.appendChild(p_tgh); } </script> <script contenteditable=""> function createArticleHeading() { var p_ah = document.createElement('p'); p_ah.innerHTML = ArticleHeading; p_ah.setAttribute('contenteditable', 'true'); p_ah.setAttribute("id","p_ah"); var content = document.getElementById('Row2Cell2'); content.appendChild(p_ah); } </script> <script> function saveAs(filename, allHtml) { allHtml = document.documentElement.outerHTML; var blob = new Blob([allHtml], {type: 'text/csv'}); if(window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else{ var elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } } </script> <script contenteditable=""> function createNewButton() { var p_bn = document.createElement("li"); p_bn.innerHTML = ButtonParagraph; p_bn.setAttribute('contenteditable', 'true'); p_bn.setAttribute("id","li-Default"); var content = document.getElementById("nav-01"); content.appendChild(p_bn); } </script> </body> </html>
  2. Well I'm almost there , not getting any 'console errors', but setAttribute are not working : address_id.setAttribute("href", useThisURL); address_id.setAttribute("download", useThisURL); I think these are the problem areas with the complete code below these: <br><a id="address_id" >Save Page As: </a> and: <script> function savePageAs() { var showMe = "nuttin happened?"; var useThisURL = prompt("If FileName is ok, Click OK , Else Change it:", document_URL) if (useThisURL != null) { alert("useThisURL= " + useThisURL); document.getElementById("address_id").innerHTML = "File Saved As: " ; showMe = document.getElementById("address_id").innerHTML ; alert("innerHTML= " + showMe); address_id.setAttribute("href", useThisURL); address_id.setAttribute("download", useThisURL); alert("address_id= " + address_id); address_id.click(); } } </script> Thanks Full code below: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3-Rows-3-Cols.html</title> <!-- file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/3-Rows-3-Cols.html https://www.dummies.com/web-design-development/css3/using-the-div-tag-to-create-tables/ https://www.freeformatter.com/html-validator.html <a href="https://developer.mozilla.org/en-US/" target="_blank"> <img src="https://mdn.mozillademos.org/files/6851/mdn_logo.png"alt="MDN logo" /> </a> --> <style type="text/css"> body { font-family:Sans-serif; margin: 0 auto; padding:0; border: 0; height: 100%; } html { height: 100%; margin: 0 auto; padding:0; border: 0; } #wholePageWrapper { height: 100%; margin: 0 auto; padding:0; } .Table { text-align: center; vertical-align: top; margin: 0 auto; padding:0; } #mainHeading { text-align: center; width: 100%; background: #BCCE98; vertical-align: top; margin: 0 auto; padding:0; } #container { padding-bottom: 1001em; margin-bottom: -1000em; overflow: hidden; margin: 0 auto; padding:0; } #Row1 { display: block; width: 100%; vertical-align: top; margin: 0 auto; padding:0; } #Row2 { display: block; width: 100%; margin: 0 auto; padding:0; } #Row3 { width: 100%; margin: 0 auto; padding:0; vertical-align: top; display: inline; } #Row1Cell1 { color: #4C4C4C; display: inline-block; text-align: center; width: 100%; font-size: 18px } #Row2Cell1 { display: inline-block; background-color: #DAE9BC; width: 20%; margin: 0 auto; float: left; padding-bottom: 1001em; margin-bottom: -1000em; } #Row2Cell2 { display: inline-block; text-align: center; width: 60%; background-color:#F8F8FF; margin: 0 auto; float:left; padding-bottom: 1001em; margin-bottom: -1000em; } #Row2Cell3 { display: inline-block; width: 20%; background: #e9f2d7; margin: 0 auto; float: right; padding-bottom: 1001em; margin-bottom: -1000em; } #Row3Cell1 { display: inline-block; width: 100%; background: #BCCE98; margin: 0 auto; overflow: auto; text-align: center; } #p_bn { text-align: left; } #p_ah { color: #4C4C4C; /* color: #555555; */ text-align: left; font-size: 16px } #p_tgh { /* color: #999999; */ color: #4C4C4C; text-align: left; font-size: 14px } #CurrentPageAddress { color: #BCCE98; } #SavePageAs_id { color: #BCCE98; } #address_id { /* color: #BCCE98; */ color: #000000; } </style> </head> <body onload="documentURL()"><!-- Run me 1st --> <div class="Table"> <!-- ============NewRow============== --> <div id="Row1"> <div id="Row1Cell1"> <p contenteditable="true"; id="mainHeading"> myMainHeading</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> <!-- ============NewRow============== --> <div id="container"> <div id="Row2"> <div id="Row2Cell1"> <p contenteditable="" style="color:#5886BC;">notes</p> </div> <!-- <div class="Cell" --> <div id="Row2Cell2"> <p contenteditable="" id="p_ah">Article Heading</p> <p contenteditable="" id="p_tgh">Text Area</p> </div> <!-- <div class="Cell" --> <div id="Row2Cell3"> <p contenteditable="true"; style="color:#576C15">notes</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> </div> <!-- id="container" --> <!-- ============NewRow============== --> <div id="Row3"> <div id="Row3Cell1"> <button onclick="createArticleHeading()">Add Article Heading</button> <button onclick="createTextArea()">Add Text Area</button> <form action="http://google.com" target="_blank" style="display: inline;"> <input type="submit" value="Search Google" /> </form> <button onclick="savePageAs()">Save This Page As</button> <!-- <a id="href_id" href="" download=""> Save This Page As </a> --> <br><a id="address_id" >Save Page As: </a> </div> <!-- <div class="Cell" --> <!-- <p id="CurrentPageAddress" align="center">_</p> --> </div> <!-- <div class="Row" --> </div> <!-- <div class="Table"> --> <script> var ArticleHeading = "Article Heading"; var TextParagraph = "Text Area"; var ButtonParagraph = "New Link"; var document_URL; function documentURL() { document_URL = document.URL; /* document.getElementById("CurrentPageAddress").innerHTML = document_URL; */ } </script> <script contenteditable=""> function createTextArea() { var p_tgh = document.createElement("p"); p_tgh.innerHTML = TextParagraph; p_tgh.setAttribute("contenteditable", "true"); p_tgh.setAttribute("id","p_tgh"); var content = document.getElementById("Row2Cell2"); content.appendChild(p_tgh); } </script> <script contenteditable=""> function createArticleHeading() { var p_ah = document.createElement('p'); p_ah.innerHTML = ArticleHeading; p_ah.setAttribute('contenteditable', 'true'); p_ah.setAttribute("id","p_ah"); var content = document.getElementById('Row2Cell2'); content.appendChild(p_ah); } </script> <script> function savePageAs() { var showMe = "nuttin happened?"; var useThisURL = prompt("If FileName is ok, Click OK , Else Change it:", document_URL) if (useThisURL != null) { alert("useThisURL= " + useThisURL); document.getElementById("address_id").innerHTML = "File Saved As: " ; showMe = document.getElementById("address_id").innerHTML ; alert("innerHTML= " + showMe); address_id.setAttribute("href", useThisURL); address_id.setAttribute("download", useThisURL); alert("address_id= " + address_id); address_id.click(); } } </script> <script contenteditable=""> function createNewButton() { alert("function createNewButton()"); var p_bn = document.createElement("li"); p_bn.innerHTML = ButtonParagraph; p_bn.setAttribute('contenteditable', 'true'); p_bn.setAttribute("id","li-Default"); // var content = document.getElementById("ul"); var content = document.getElementById("nav-01"); content.appendChild(p_bn); } </script> </body> </html>
  3. Thanks, I was hoping to just force the saveas dialog . So that the user could chose to change the filename . I suppose that I could Prompt the user 1st with the name (document.URL;) and give them the option to change it or not. Then download the page . Think I'll give that a shot. Thanks
  4. Thanks, I was hoping it would be this easy: <!DOCTYPE html> <html> <body> <p>just a paragraph <p> <a href="" download=""> Save This Page As </a> </body> </html> It is, if I'm talking with the server , which I don't want to do . I want to do it locally . Will I need to supply the name of "This Page" ? Or is there an abbreviated version ? Thanks
  5. Hello & Thanks , I would like an Html5 button to Trigger a 'Download File prompt ' for all browsers . Rather than clicking on for example [Browser Customize and Control ] , then clicking [More tools] [Save Page As] etc.. I searched, but nothing related came up . How can this be accomplished ? Thanks for your help !
  6. Thanks , That did it . I did use DevTools but didn't interpret it as anything wrong . I am checking out overflow here: https://www.w3schools.com/cssref/pr_pos_overflow.asp As always. Thanks
  7. Ah... That worked great for between Row1 and Row2 . But between Row2 and Row3 there is still a space . I tried variations of vertical-align: top; and vertical-align: bottom; and margin-bottom: 1001em; and margin-bottom: -1000em; but no go yet . Thanks <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3-Rows-3-Cols.html</title> <!-- file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/3-Rows-3-Cols.html https://www.dummies.com/web-design-development/css3/using-the-div-tag-to-create-tables/ https://www.freeformatter.com/html-validator.html --> <style type="text/css"> body { font-family:Sans-serif; /* line-height: 1.5em; */ margin: 0 auto; padding:0; border: 0; vertical-align: top; } html { margin: 0 auto; padding:0; border: 0; } .Table { text-align: center; vertical-align: top; margin: 0 auto; padding:0; } #mainHeading { text-align: center; width: 100%; background: #BCCE98; vertical-align: top; margin: 0 auto; padding:0; } #container { padding-bottom: 1001em; margin-bottom: -1000em; overflow: hidden; margin: 0 auto; padding:0; } #Row1 { display: block; width: 100%; vertical-align: top; margin: 0 auto; padding:0; } #Row2 { display: block; width: 100%; margin: 0 auto; padding:0; vertical-align: top; } #Row3 { display: block; width: 100%; margin: 0 auto; padding:0; vertical-align: top; } #Row1Cell1 { display: inline-block; text-align: center; width: 100%; } #Row2Cell1 { display: inline-block; background-color: #DAE9BC; width: 15%; margin: 0 auto; float: left; padding-bottom: 1001em; margin-bottom: -1000em; } #Row2Cell2 { display: inline-block; text-align: center; width: 70%; background-color:#F8F8FF; margin: 0 auto; float:left; padding-bottom: 1001em; margin-bottom: -1000em; } #Row2Cell3 { display: inline-block; width: 15%; background: #e9f2d7; margin: 0 auto; float: right; padding-bottom: 1001em; margin-bottom: -1000em; } #Row3Cell1 { display: block; width: 100%; background: #BCCE98; margin: 0 auto; } </style> </head> <body> <br> <div class="Table"> <!-- ============NewRow============== --> <div id="Row1"> <div id="Row1Cell1"> <p id="mainHeading"> myMainHeading</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> <div id="container"> <!-- ============NewRow============== --> <div id="Row2"> <div id="Row2Cell1"> <p> Row 2 Column 1</p> </div> <!-- <div class="Cell" --> <div id="Row2Cell2"> <p> Row 2 Column 2 </p> </div> <!-- <div class="Cell" --> <div id="Row2Cell3"> <p> Row 2 Column 3 </p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> </div> <!-- id="container" --> <!-- ============NewRow============== --> <div id="Row3"> <div id="Row3Cell1"> <p>Row 3 Column 1</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> </div> <!-- <div class="Table"> --> </body> </html>
  8. Hello & Thanks, How to eliminate verticle space between Divs ? I have tried gazillions of solutions but none of them work . Thanks for your help ! <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3-Rows-3-Cols.html</title> <!-- file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/3-Rows-3-Cols.html https://www.dummies.com/web-design-development/css3/using-the-div-tag-to-create-tables/ https://www.freeformatter.com/html-validator.html --> <style type="text/css"> body { font-family:Sans-serif; line-height: 1.5em; margin: 0 auto; padding:0; border: 0; vertical-align: top; } html { margin: 0 auto; padding:0; border: 0; } .Table { text-align: center; vertical-align: top; margin: 0 auto; padding:0; } #mainHeading { text-align: center; width: 100%; background: #BCCE98; vertical-align: top; margin: 0 auto; padding:0; } #Row1 { width: 100%; vertical-align: top; margin: 0 auto; padding:0; display: block; } #container { padding-bottom: 1001em; margin-bottom: -1000em; overflow: hidden; vertical-align: top; margin: 0 auto; padding:0; } #Row2 { display: inline-block; width: 100%; margin: 0 auto; padding:0; display: block; vertical-align: top; } #Row3 { display: inline-block; width: 100%; margin: 0 auto; padding:0; display: block; vertical-align: top; } #Row1Cell1 { display: inline-block; text-align: center; width: 100%; } #Row2Cell1 { display: inline-block; background-color: #DAE9BC; width: 15%; margin: 0 auto; float: left; } #Row2Cell2 { display: inline-block; text-align: center; width: 70%; background-color:#F8F8FF; margin: 0 auto; float:left; } #Row2Cell3 { display: inline-block; width: 15%; background: #e9f2d7; margin: 0 auto; float: right; } #Row3Cell1 { width: 100%; height:70px; background: #BCCE98; margin: 0 auto; } </style> </head> <body> <br> <div class="Table"> <!-- ============NewRow============== --> <div id="Row1"> <div id="Row1Cell1"> <p id="mainHeading"> myMainHeading</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> <!-- ============NewRow============== --> <p></p> <div id="container"> <div id="Row2"> <div id="Row2Cell1"> <p> Row 2 Column 1</p> </div> <!-- <div class="Cell" --> <div id="Row2Cell2"> <p> Row 2 Column 2</p> </div> <!-- <div class="Cell" --> <div id="Row2Cell3"> <p> Row 2 Column 3</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> </div> <!-- id="container" --> <!-- ============NewRow============== --> <p></p> <div id="Row3"> <div id="Row3Cell1"> <p>Row 3 Column 1</p> </div> <!-- <div class="Cell" --> </div> <!-- <div class="Row" --> </div> <!-- <div class="Table"> --> </body> </html>
  9. Thanks , Sorry , I am getting hung up on the term 'anchor ' . Is this the anchor? : var p_bn = document.createElement("li"); Thanks
  10. Hi dsonesuk ; Using your var inner_parent = content.getElementsByTagName('ul')[0] It's not working for me . I must have coded it wrong. With the code below I expected to get two "New Link" s . But only got 1 . Pls , tell me what is my mistake ? Thanks <script contenteditable=""> function createNewButton() { // alert("function createNewButton()"); var p_bn = document.createElement("li"); p_bn.innerHTML = ButtonParagraph; p_bn.setAttribute('contenteditable', 'true'); p_bn.setAttribute("id","li_Default"); var content = document.getElementById('ul_01'); content.appendChild(p_bn); var inner_parent = content.getElementsByTagName('ul')[0]; inner_parent.appendChild(inner_parent); } </script> It's the same code as in my last Post , except for the last two lines . I can Post the whole code it you like .
  11. Ah... finally , I got it: However , still 1 problem left: // var content = document.getElementById('ul'); // var content = document.getElementById('nav-01.ul'); var content = document.getElementById('nav-01'); content.appendChild(p_bn); The content.appendChild(p_bn); only works for var content = document.getElementById('nav-01'); . Which puts it AFTER <ul></ul> . But I want it to be put within <ul> as an appendChild . Pls , How can I put the child within <ul> ? Here is the whole mini-mini code" <!DOCTYPE html> <!-- saved from url=(0065)file:///C:/Users/vmars/Desktop/Downloads/Html-MasterWIP-Mini.html --> <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Html-MasterWIP-Mini.html</title> <!-- https://www.freeformatter.com/html-validator.html --> <style> body {margin:0; padding:0; font-family: Sans-Serif; line-height: 1.5em; } #header, h1 { margin: 0; padding-top: 10px; text-align: center; background: #ccc; height: 50px; } #content { margin-left: 230px; /* Same as 'nav' width */ } #p_bn { text-align: left; } #li-Default{ text-align: left; } </style> </head> <body onload="documentURL()"><!-- Run me 1st --> <p id="CurrentPageAddress" align="center">file:///C:/Users/vmars/Desktop/Downloads/Html-MasterWIP-Mini.html</p> <div id="nav-01"> <ul> <li><a contenteditable id="li-Default" href="https://www.google.com/">Search Google</a> </li> </ul> </div> <div id="buttonDiv" align="center"> <button onclick="createNewButton()">Add New Button</button> </div> <script> var ButtonParagraph = "New Link" var document_URL function documentURL() { document_URL = document.URL; document.getElementById("CurrentPageAddress").innerHTML = document_URL; } </script> <script contenteditable=""> function createNewButton() { // alert("function createNewButton()"); var p_bn = document.createElement("li"); p_bn.innerHTML = ButtonParagraph; p_bn.setAttribute('contenteditable', 'true'); p_bn.setAttribute("id","li-Default"); // var content = document.getElementById('ul'); // var content = document.getElementById('nav-01.ul'); var content = document.getElementById('nav-01'); content.appendChild(p_bn); } </script> </body></html> Thanks
  12. Thanks dsonesuk : Oops , I forgot all about : https://www.freeformatter.com/html-validator.html I would like to try that later . Right now my mind set is on 1st working it out with <p> . I put a new example here: http://vmars.us/ShowMe/Html-MasterWIP-Mini-Debug.html Pls , take a look at the source . So there is something I would like to add within each created <p> element . And that is its id="p_ah" and id="p_tgh" elements repectively . I tried: p_tgh.setAttribute("contenteditable", "true" , "id="p_tgh""); But its a no go . Pls, how can I do this ? Thanks
  13. Hi Funce , Those are all cleared up the link below . Kindly go to : http://vmars.us/ShowMe/Html-MasterWIP-Mini.html Try clicking on the [Add New Text Area] Button . Note that the 1st 'Text Paragraph' is Grey , all subsequent 'Text Paragraph's are black . I want them all to be Grey . Pls , how can I correct that ? Thanks for your help !
  14. Here is page code minified . What is troubling me , is that the style settings for ArticleHeading(#p_ah) & TextHeading(p_tgh) are not working . Here is the working page online: Pls, show me how to fix this . http://vmars.us/ShowMe/Html-MasterWIP-Mini.html Thanks for your help ! <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Master-WIP-Mini.html</title> <style> body {margin:0; padding:0; font-family: Sans-Serif; line-height: 1.5em; } #header, h1 { margin: 0; padding-top: 10px; text-align: center; background: #ccc; height: 50px; } #wrapper { overflow: hidden; } #section { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 100%; } #content { margin-left: 230px; /* Same as 'nav' width */ } .innertube {margin: 15px; /* Padding for content */ margin-top: 0; } p { color: #000555; } #p_bn { text-align: left; } #p_ah { color: #555555; text-align: left; font-size: 18px } #p_tgh { color: #999999; text-align: left; font-size: 12px font-size: 12px } #footer { clear: left; width: 100%; background: #ccc; text-align: center; padding: 4px 0; } </style> </head> <body onload="documentURL()"> <p id="CurrentPageAddress" align="center">Html-MasterWIP-Mini.html</p> <header id="header"> <div id="innertube-01"> <br> <h1 contenteditable="">my Main Header</h1> </div> </header> <div id="wrapper"> <section id="section"> <div id="content"> <div id="innertube-02"> <!-- div.section.content.innertube.p --> <p contenteditable="" id="p_ah">Article Heading</p> <p contenteditable="" id="p_tgh">Text paragraph</p> </div> </section> <nav id="nav-01"> <h1 contenteditable="">Go To Links</h1> <ul> <div id="innertube-03"> <li><a id="li-01" href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-01.html">Link 1</a></li> <li><a id="li-02" href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-02.html">Link 2</a></li> <li><a id="li-03" href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-03.html">Link 3</a></li> <li><a id="li-Last" href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/Hey-Buddy.html">Hey Buddy !</a></li> </nav> </div> <footer id="footer"> <div id="innertube-04"> <p contenteditable="">Footer...</p> </div> </footer> <div id="buttonDiv" align="center"> <!-- Buttons Header createNewLink --> <button onclick="createNewButton()">Add New Button</button> <button onclick="createArticleHeading()">Add New Article Heading</button> <button onclick="createTextArea()">Add New Text Area</button> </div> <script id="js" contenteditable=""> function createTextArea() { var p_tgh = document.createElement("p"); p_tgh.innerHTML = TextParagraph; p_tgh.setAttribute("contenteditable", "true"); var content = document.getElementById("innertube-02"); content.appendChild(p_tgh); } </script> <script id="js" contenteditable=""> function createArticleHeading() { var p_ah = document.createElement('p'); p_ah.innerHTML = ArticleHeading; p_ah.setAttribute('contenteditable', 'true'); var content = document.getElementById('innertube-02'); content.appendChild(p_ah); } </script> <script> var ArticleHeading = "Article Heading" var TextParagraph = "Text Paragraph" var ButtonParagraph = "New Link" var document_URL function documentURL() { document_URL = document.URL; document.getElementById("CurrentPageAddress").innerHTML = document_URL; } </script> <script id="js" contenteditable=""> function createNewButton() { var p_bn = document.createElement('li-Last'); p_bn.innerHTML = ButtonParagraph; p_bn.setAttribute('contenteditable', 'true'); var content = document.getElementById('innertube-03'); content.appendChild(p_bn); } </script> </body> </html>
  15. I am thinking the reason I haven't received any replies is that this Post is too long . So I am working on a miniature version of this . I'll be back .
  16. I am still working on the same html, css and js, problem (contenteditable & creating Articleheader/TexrArea) working code here: http://vmars.us/ShowMe/DIY-Html-Master-WIP-02.html <!DOCTYPE html> <html> <!-- Go To https://www.google.com/search?num=20&newwindow=1&hl=en&authuser=0&ei=XetDXJKlG46GtQXV1J9Q&q=html5+css+js&oq=html5+css+js&gs_l=psy-ab.12..35i39j0j0i22i30l6j0i22i10i30j0i22i30.239301.283270..287372...2.0..0.112.3082.19j14......0....1..gws-wiz.....6..0i71j0i13i30j0i8i13i30j0i131j0i20i263.RsTbO1V_iYY --> <!-- Go To file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/DIY-Html-Master-WIP-01.html --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>DIY-Html-Master-WIP-01.html</title> <style > body { margin:0; padding:0; font-family: Sans-Serif; line-height: 1.5em; } #header { background: #ccc; <!-- height: 100px; --> text-align: center; } #header { margin: 0; padding-top: 0px; padding-bottom: 15px; text-align: center; font-size: 12px; } p { font-size: 18px; font-style: normal; } #p_tgh { font-size: 12px; font-style: normal; } #p_ah { font-size: 18px; font-style: bold; } #section { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 100%; } #nav { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 230px; margin-left: -100%; background: #eee; } #footer { clear: left; width: 100%; background: #ccc; text-align: center; padding: 4px 0; } #wrapper { overflow: hidden; } #content { margin-left: 230px; /* Same as 'nav' width */ } .innertube { margin: 15px; /* Padding for content */ margin-top: 0; } li { list-style-type:none; <!-- color: #555555; --> } nav ul { list-style-type: none; margin: 0; padding: 0; } nav ul a { color: darkgreen; text-decoration: none; } </style> </head> <body> <header id="header"> <div class="innertube"> <br> <h1 contenteditable >DIY-Html-Master-WIP-01.html</h1> </div> </header> <div id="wrapper"> <!-- --> <section id="section"> <div id="content"> <div class="innertube"> <p contenteditable id="p_ah" >Article Heading</p> <p contenteditable id="p_tgh" >Text paragraph</p> </div> </div> </section> <nav id="nav"> <div class="innertube"> <h2 contenteditable >URL Links</h2> <ul> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-01.html">Link 1</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-02.html">Link 2</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-03.html">Link 3</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/Hey-Buddy.html">Hey Buddy !</a></li> </ul> </div> </nav> </div> <footer id="footer"> <div class="innertube"> <p contenteditable >Footer...</p> </div> </footer> <div> <!-- Buttons Header createNewLink --> <button onclick="createNewLink()">Add New Link</button> <button onclick="createArticleHeader()">Add New Article Heading</button> <button onclick="createTextArea()">Add New Text Area</button> </div> <!-- Buttons Header --> <script id="js" contenteditable > function createNewLink(text= "NewLink") { var li_nl = document.createElement("li"); <!-- alert("I am an alert box!"); --> li_nl.innerHTML = text; li_nl.setAttribute("contenteditable", "true"); var nav = document.getElementById("nav"); nav.appendChild(li_nl); } </script> <script id="js" contenteditable > function createTextArea(text= "Text paragraph") { var p_tgh = document.createElement("p"); p_tgh.innerHTML = text; p_tgh.setAttribute("contenteditable", "true"); var content = document.getElementById("content"); content.appendChild(p_tgh); } </script> <script id="js" contenteditable > function createArticleHeader(text= "Article Heading") { var p_ah = document.createElement("p"); // alert{"p_ah"}; p_ah.innerHTML = text; p_ah.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p_ah); } </script> <!DOCTYPE html> <html> <!-- Go To https://www.google.com/search?num=20&newwindow=1&hl=en&authuser=0&ei=XetDXJKlG46GtQXV1J9Q&q=html5+css+js&oq=html5+css+js&gs_l=psy-ab.12..35i39j0j0i22i30l6j0i22i10i30j0i22i30.239301.283270..287372...2.0..0.112.3082.19j14......0....1..gws-wiz.....6..0i71j0i13i30j0i8i13i30j0i131j0i20i263.RsTbO1V_iYY --> <!-- Go To file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/DIY-Html-Master-WIP-01.html --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>DIY-Html-Master-WIP-01.html</title> <style > body { margin:0; padding:0; font-family: Sans-Serif; line-height: 1.5em; } #header { background: #ccc; <!-- height: 100px; --> text-align: center; } #header { margin: 0; padding-top: 0px; padding-bottom: 15px; text-align: center; font-size: 12px; } p { font-size: 18px; font-style: normal; } #p_tgh { font-size: 12px; font-style: normal; } #p_ah { font-size: 18px; font-style: bold; } #section { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 100%; } #nav { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 230px; margin-left: -100%; background: #eee; } #footer { clear: left; width: 100%; background: #ccc; text-align: center; padding: 4px 0; } #wrapper { overflow: hidden; } #content { margin-left: 230px; /* Same as 'nav' width */ } .innertube { margin: 15px; /* Padding for content */ margin-top: 0; } li { list-style-type:none; <!-- color: #555555; --> } nav ul { list-style-type: none; margin: 0; padding: 0; } nav ul a { color: darkgreen; text-decoration: none; } </style> </head> <body> <header id="header"> <div class="innertube"> <br> <h1 contenteditable >DIY-Html-Master-WIP-01.html</h1> </div> </header> <div id="wrapper"> <!-- --> <section id="section"> <div id="content"> <div class="innertube"> <p contenteditable id="p_ah" >Article Heading</p> <p contenteditable id="p_tgh" >Text paragraph</p> </div> </div> </section> <nav id="nav"> <div class="innertube"> <h2 contenteditable >URL Links</h2> <ul> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-01.html">Link 1</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-02.html">Link 2</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-03.html">Link 3</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/Hey-Buddy.html">Hey Buddy !</a></li> </ul> </div> </nav> </div> <footer id="footer"> <div class="innertube"> <p contenteditable >Footer...</p> </div> </footer> <div> <!-- Buttons Header createNewLink --> <button onclick="createNewLink()">Add New Link</button> <button onclick="createArticleHeader()">Add New Article Heading</button> <button onclick="createTextArea()">Add New Text Area</button> </div> <!-- Buttons Header --> <script id="js" contenteditable > function createTextArea(text= "Text paragraph") { var p_tgh = document.createElement("p"); p_tgh.innerHTML = text; p_tgh.setAttribute("contenteditable", "true"); var content = document.getElementById("content"); content.appendChild(p_tgh); } </script> <script id="js" contenteditable > function createArticleHeader(text= "Article Heading") { var p_ah = document.createElement("p"); // alert{"p_ah"}; p_ah.innerHTML = text; p_ah.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p_ah); } </script> </body></html></script> Thanks for help
  17. I am still working on the same html, css and js, problem (contenteditable & creating Articleheader/TexrArea) full code here: http://vmars.us/ShowMe/DIY-Html-Master-WIP-02.html <!DOCTYPE html> <html> <!-- Go To https://www.google.com/search?num=20&newwindow=1&hl=en&authuser=0&ei=XetDXJKlG46GtQXV1J9Q&q=html5+css+js&oq=html5+css+js&gs_l=psy-ab.12..35i39j0j0i22i30l6j0i22i10i30j0i22i30.239301.283270..287372...2.0..0.112.3082.19j14......0....1..gws-wiz.....6..0i71j0i13i30j0i8i13i30j0i131j0i20i263.RsTbO1V_iYY --> <!-- Go To file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/DIY-Html-Master-WIP-01.html --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>DIY-Html-Master-WIP-01.html</title> <style > body { margin:0; padding:0; font-family: Sans-Serif; line-height: 1.5em; } #header { background: #ccc; <!-- height: 100px; --> text-align: center; } #header { margin: 0; padding-top: 0px; padding-bottom: 15px; text-align: center; font-size: 12px; } p { font-size: 18px; font-style: normal; } #p_tgh { font-size: 12px; font-style: normal; } #p_ah { font-size: 18px; font-style: bold; } #section { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 100%; } #nav { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 230px; margin-left: -100%; background: #eee; } #footer { clear: left; width: 100%; background: #ccc; text-align: center; padding: 4px 0; } #wrapper { overflow: hidden; } #content { margin-left: 230px; /* Same as 'nav' width */ } .innertube { margin: 15px; /* Padding for content */ margin-top: 0; } li { list-style-type:none; <!-- color: #555555; --> } nav ul { list-style-type: none; margin: 0; padding: 0; } nav ul a { color: darkgreen; text-decoration: none; } </style> </head> <body> <header id="header"> <div class="innertube"> <br> <h1 contenteditable >DIY-Html-Master-WIP-01.html</h1> </div> </header> <div id="wrapper"> <!-- --> <section id="section"> <div id="content"> <div class="innertube"> <p contenteditable id="p_ah" >Article Heading</p> <p contenteditable id="p_tgh" >Text paragraph</p> </div> </div> </section> <nav id="nav"> <div class="innertube"> <h2 contenteditable >URL Links</h2> <ul> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-01.html">Link 1</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-02.html">Link 2</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-03.html">Link 3</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/Hey-Buddy.html">Hey Buddy !</a></li> </ul> </div> </nav> </div> <footer id="footer"> <div class="innertube"> <p contenteditable >Footer...</p> </div> </footer> <div> <!-- Buttons Header createNewLink --> <button onclick="createNewLink()">Add New Link</button> <button onclick="createArticleHeader()">Add New Article Heading</button> <button onclick="createTextArea()">Add New Text Area</button> </div> <!-- Buttons Header --> <script id="js" contenteditable > function createNewLink(text= "NewLink") { var li_nl = document.createElement("li"); <!-- alert("I am an alert box!"); --> li_nl.innerHTML = text; li_nl.setAttribute("contenteditable", "true"); var nav = document.getElementById("nav"); nav.appendChild(li_nl); } </script> <script id="js" contenteditable > function createTextArea(text= "Text paragraph") { var p_tgh = document.createElement("p"); p_tgh.innerHTML = text; p_tgh.setAttribute("contenteditable", "true"); var content = document.getElementById("content"); content.appendChild(p_tgh); } </script> <script id="js" contenteditable > function createArticleHeader(text= "Article Heading") { var p_ah = document.createElement("p"); // alert{"p_ah"}; p_ah.innerHTML = text; p_ah.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p_ah); } </script> <!DOCTYPE html> <html> <!-- Go To https://www.google.com/search?num=20&newwindow=1&hl=en&authuser=0&ei=XetDXJKlG46GtQXV1J9Q&q=html5+css+js&oq=html5+css+js&gs_l=psy-ab.12..35i39j0j0i22i30l6j0i22i10i30j0i22i30.239301.283270..287372...2.0..0.112.3082.19j14......0....1..gws-wiz.....6..0i71j0i13i30j0i8i13i30j0i131j0i20i263.RsTbO1V_iYY --> <!-- Go To file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/DIY-Html-Master-WIP-01.html --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>DIY-Html-Master-WIP-01.html</title> <style > body { margin:0; padding:0; font-family: Sans-Serif; line-height: 1.5em; } #header { background: #ccc; <!-- height: 100px; --> text-align: center; } #header { margin: 0; padding-top: 0px; padding-bottom: 15px; text-align: center; font-size: 12px; } p { font-size: 18px; font-style: normal; } #p_tgh { font-size: 12px; font-style: normal; } #p_ah { font-size: 18px; font-style: bold; } #section { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 100%; } #nav { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 230px; margin-left: -100%; background: #eee; } #footer { clear: left; width: 100%; background: #ccc; text-align: center; padding: 4px 0; } #wrapper { overflow: hidden; } #content { margin-left: 230px; /* Same as 'nav' width */ } .innertube { margin: 15px; /* Padding for content */ margin-top: 0; } li { list-style-type:none; <!-- color: #555555; --> } nav ul { list-style-type: none; margin: 0; padding: 0; } nav ul a { color: darkgreen; text-decoration: none; } </style> </head> <body> <header id="header"> <div class="innertube"> <br> <h1 contenteditable >DIY-Html-Master-WIP-01.html</h1> </div> </header> <div id="wrapper"> <!-- --> <section id="section"> <div id="content"> <div class="innertube"> <p contenteditable id="p_ah" >Article Heading</p> <p contenteditable id="p_tgh" >Text paragraph</p> </div> </div> </section> <nav id="nav"> <div class="innertube"> <h2 contenteditable >URL Links</h2> <ul> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-01.html">Link 1</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-02.html">Link 2</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/DIY-Html-03.html">Link 3</a></li> <li><a href="file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/Hey-Buddy.html">Hey Buddy !</a></li> </ul> </div> </nav> </div> <footer id="footer"> <div class="innertube"> <p contenteditable >Footer...</p> </div> </footer> <div> <!-- Buttons Header createNewLink --> <button onclick="createNewLink()">Add New Link</button> <button onclick="createArticleHeader()">Add New Article Heading</button> <button onclick="createTextArea()">Add New Text Area</button> </div> <!-- Buttons Header --> <script id="js" contenteditable > function createTextArea(text= "Text paragraph") { var p_tgh = document.createElement("p"); p_tgh.innerHTML = text; p_tgh.setAttribute("contenteditable", "true"); var content = document.getElementById("content"); content.appendChild(p_tgh); } </script> <script id="js" contenteditable > function createArticleHeader(text= "Article Heading") { var p_ah = document.createElement("p"); // alert{"p_ah"}; p_ah.innerHTML = text; p_ah.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p_ah); } </script> </body></html></script> Thanks for help
  18. Hello & Thanks ; I did read https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters But it was too much info , I couldn't understand it . I have heard that using global variables is bad practice . Is that true here ? It all runs fine . I read thru w3Schools js css html Tutorials years ago . So yesterday & today , i read thru this series of Tutorials : https://www.digitalocean.com/community/tutorial_series/understanding-the-dom-document-object-model I highly recommend it to newbies or oldies like me . Thanks All
  19. Thanks; I thought I would try global variables . <script type='text/javascript' > var NewLink = "New Link" var TextParagraph = "Text Paragraph" var ArticleHeading = "Article Heading" </script> <script id="js" contenteditable > function createNewLink() { var li_nl = document.createElement("li"); li_nl.innerHTML = NewLink; alert(' function createNewLink = ' + NewLink); li_nl.setAttribute("contenteditable", "true"); var nav = document.getElementById("nav"); nav.appendChild(li_nl); } </script> The Alert works fine . Thanks
  20. Hello & Thanks : Here is my code: <script id="js" contenteditable > function createArticleHeader(text= "Article Heading") { var p_ah = document.createElement('p'); alert{"p_ah"}; p_ah.innerHTML = text; p_ah.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p_ah); } createArticleHeader("Article Header"); </script> This code runs great, without the alert . But when I add the alert{} line , it doesn't run at all . Is alert{} in the wrong place or what ? Thanks for your help .
  21. Thanks Funce Wow Thank you very much ! It works great ! http://vmars.us/ShowMe/DIY-Html-Master-WIP-01.html I have a lot more to do , but you jump started me . I will Post the final version here later. Thanks
  22. Thanks; "Your text is 'undefined' due to the fact you call CreateTextArea() without any arguments. Which means the text variable is undefined." Sorry , I don't understand what you mean. Pls , explain further. The other errors , I'm working on them. Thanks
  23. Thanks BILU KUMAR SAU : Plenty interesting . Sorry , I should have specified , pure js only . At this point I would rather not tackle learning jquery . Thanks
  24. Hello & Thanks , I have been away from coding a while: I'm having trouble connecting css html and js . Problem areas are: p, ah { font-size: 2em; color: #ffdddd; } p, tgh { font-size: 1em; color: #ddffdd; } and <div id="wrapper"> <section id="section"> <div id="content"> <div class="innertube"> <p contenteditable id="ah" >Article Heading</p> <p contenteditable id="tgh">Text goes here:</p> <p> <!-- <script>generateText(20)<script> --> </p> </div> </div> </section> <div> and <script id="js" contenteditable > function createArticleHeader(text) { var p = document.createElement('p'); p.innerHTML = text; p.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p); } createArticleHeader("ArticleHeader..."); createTextArea(); </script> <script id="js" contenteditable > function createTextArea(text) { var p.tgh = document.createElement('p.tgh'); p.tgh.innerHTML = text; p.tgh.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p.tgh); } createTextArea("Text goes here:"); </script> Start-up time thru it runs fine but" When click createArticleHeader button it runs fine the first time but from then on it shows an "undefined" error . When click TextGoesHere button it doesn't run at all . I need help . <!DOCTYPE html> <html> <!-- How to link css to html and js ? --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>MiniCode-For-Forum.html</title> <style > body { margin:0; padding:0; font-family: Sans-Serif; line-height: 1.5em; } #section { padding-bottom: 10010px; margin-bottom: -10000px; float: left; width: 100%; } #wrapper { overflow: hidden; } #content { margin-left: 230px; /* Same as 'nav' width */ } .innertube { margin: 15px; /* Padding for content */ margin-top: 0; } p { color: #000555; } </style> <style> p, ah { font-size: 2em; color: #ffdddd; } p, tgh { font-size: 1em; color: #ddffdd; } </style > </head> <body> <div id="wrapper"> <section id="section"> <div id="content"> <div class="innertube"> <p contenteditable id="ah" >Article Heading</p> <p contenteditable id="tgh">Text goes here:</p> <p> <!-- <script>generateText(20)<script> --> </p> </div> </div> </section> <div> <!-- Buttons Header --> <button onclick="createArticleHeader()">Add New Article Heading</button> <button onclick="createTextArea()">Text goes here:</button> </div> <!-- Buttons Header --> <script id="js" contenteditable > function createArticleHeader(text) { var p = document.createElement('p'); p.innerHTML = text; p.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p); } createArticleHeader("ArticleHeader..."); createTextArea(); </script> <script id="js" contenteditable > function createTextArea(text) { var p.tgh = document.createElement('p.tgh'); p.tgh.innerHTML = text; p.tgh.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p.tgh); } createTextArea("Text goes here:"); </script> </body> </html> Sorry for the long Post . Thanks for your help !
  25. THanks Funce , This is useful : https://www.w3schools.com/tags/default.asp . This is useful too : https://www.w3.org/TR/CSS2/propidx.html But the one I am looking for Lists the element "table", then shows what properties are valid for that element "same table" . I am thinking it was on w3schools .
×
×
  • Create New...