[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Changing Font

Posted on 2004-11-03
2
Medium Priority
?
321 Views
Last Modified: 2013-12-03
On my website i have the code

<script language="javascript">
function imagechange()
{
  document.all['infobar'].innerHTML = 'hello my text';
}
</script>

how do i change the font size and type in the javascript?

Thanx in Advance
0
Comment
Question by:mattewjones
  • 2
2 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 200 total points
ID: 12487274
<script type="text/javascript">
function imagechange()
{
   obj=document.getElementById('infobar');
   obj.innerHTML='hello mytext';
   obj.style.fontSize='15px';
   obj.style.fontFamily='arial';
}
</script>


Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12488501
Glad I could help.  Thanks for the A. :^)

Cd&
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question