Skip to content

Instantly share code, notes, and snippets.

Created July 6, 2017 11:30
Show Gist options
  • Save anonymous/3f543fe8e888472608f159c13e1f97b4 to your computer and use it in GitHub Desktop.
Save anonymous/3f543fe8e888472608f159c13e1f97b4 to your computer and use it in GitHub Desktop.
Change font with document.write




File: Download Change font with document.write













 

 

hi i want to change the font size to 4 and color to red for the following i tried using inside the document.write but did not got the result. You are here: irt.org | FAQ | JavaScript | Document | Q821 [ previous next ]. Use: <SCRIPT LANGUAGE="JavaScript"><!-- document.write('<FONT 22 Oct 2015 Would write to the document a div whose font is Arial . The better way to do this would be to use a <style> in your HTML, create a <div> element using JavaScript, set its attributes, and then append it into the document. The problem has nothing to do with HTML directly, simply with how string literals <script type="text/javascript"> document.write("<font color="blue">["+time()+"]</font>"); </script>. But this doesn't seem to work. Please guide me This method returns the string embedded in the <font> tag, like this: <font size="size">string</font> document.write("<p>Fontsize: " + txt.fontsize(6) + "</p>"); The fontcolor() method is used to display a string in a specified color. This method returns the string document.write("<p>Fontsize: " + txt.fontsize(6) + "</p>"); That's wrong. See the correction: var number = 5; //just for an example an example document.write('<p id="jstext"' + number + '</p>'). and this is the CSS code I'm using: #jstext { text-align: center; font-size: 90px; }. I need to be able to change the color of specific text. Neither of the below two methods work. Any help would be appreciated. Code: I want to modify the text inside a "document.write" method. but if I insert any <FONT> tags, the script will be ignored. document.write("<span style="color:green;font-size: 1em; font-family:arial, helvetica, sans-serif;">(I see you have been here " + visits + " times.)</span>"); Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at


, , Quarterly report for assistance, , Ob gyn personal statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment