Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Style issue

Posted on 2003-02-22
4
Medium Priority
?
148 Views
Last Modified: 2010-04-09
I want to write x to be squared, ie x2 but the 2 is to the power of x.
how do i get the 2 like that??

0
Comment
Question by:Alk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:reubenbell
ID: 7998379
I dont get it do you mean.

<script>
var x = 2;
document.write("square of x: " + parseFloat((x * x)))

var y = Math.pow(x, 2);
document.write("y = xpower of 2: " + y)

//i think you might want this
var pow = 3; //power of newx
var newx = 5;

var curnum = newx;
for (var i=0;i<(pow+1);i++){
   curnum = curnum * curnum;
}
document.write(newx + " to the power of " + pow + " is " + curnum)
</script>
0
 

Accepted Solution

by:
Indurain earned 140 total points
ID: 8000099
Alk,

You can use the <sup> tag

e.g., x<sup>2</sup>  should produce the desired result.

Hope this helps.

0
 

Expert Comment

by:reubenbell
ID: 8000454
lol, thats what he ****ing meant.

sorry,
!!!
RB

(should have got points for effort tho, hehe)
0
 

Author Comment

by:Alk
ID: 8002496
Excellent
Sorry for the confusion!!
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

722 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