After inputing a value into a input, out a string with the RADICAL (value)
up vote
-1
down vote
favorite
So... I am trying something pretty ambitious (at least for myself). I am having difficulty finding a specific command or line of code that will do the following in HTML5
<body>
<p> The square root will go underneath </p> <input id="Number"><button onclick="ARE_YOU_SERIOUS">Check it</button>
<p id="Place Holder"></p>
<script>
function ARE_YOU_SERIOUS()
var x = document.getElementbyId("Number").value
document.getElementbyId("Place_Holder").innerhtml = SQUARE ROOT(x)
</script>
I do not want to calculate the square root of x, I just want to print a square root that will contain x in a specific placeholder
html math styles
|
show 2 more comments
up vote
-1
down vote
favorite
So... I am trying something pretty ambitious (at least for myself). I am having difficulty finding a specific command or line of code that will do the following in HTML5
<body>
<p> The square root will go underneath </p> <input id="Number"><button onclick="ARE_YOU_SERIOUS">Check it</button>
<p id="Place Holder"></p>
<script>
function ARE_YOU_SERIOUS()
var x = document.getElementbyId("Number").value
document.getElementbyId("Place_Holder").innerhtml = SQUARE ROOT(x)
</script>
I do not want to calculate the square root of x, I just want to print a square root that will contain x in a specific placeholder
html math styles
Provide a Minimal, Complete, and Verifiable example
– LGSon
Nov 17 at 21:29
How much more basic do you want me to get, I just want to print a sqrt(x) as a sqrt(x) with the radical and the x inside of it, but I will try to make a minimal code
– Alex Carlson
Nov 17 at 21:35
So we understand what it is you ask. Anddocument.getElementbyId("Number").value
return the input value as astring
, not anumber
, so you might want to do e.g.SQUARE ROOT(parseInt(x))
– LGSon
Nov 17 at 21:43
I have added a image of 2 different EXAMPLES of what I would like to see after running the script
– Alex Carlson
Nov 17 at 21:50
1
You can't do this with just Unicode characters, you need something like MathML. See for example this question and its answers.
– James K Polk
Nov 18 at 0:51
|
show 2 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
So... I am trying something pretty ambitious (at least for myself). I am having difficulty finding a specific command or line of code that will do the following in HTML5
<body>
<p> The square root will go underneath </p> <input id="Number"><button onclick="ARE_YOU_SERIOUS">Check it</button>
<p id="Place Holder"></p>
<script>
function ARE_YOU_SERIOUS()
var x = document.getElementbyId("Number").value
document.getElementbyId("Place_Holder").innerhtml = SQUARE ROOT(x)
</script>
I do not want to calculate the square root of x, I just want to print a square root that will contain x in a specific placeholder
html math styles
So... I am trying something pretty ambitious (at least for myself). I am having difficulty finding a specific command or line of code that will do the following in HTML5
<body>
<p> The square root will go underneath </p> <input id="Number"><button onclick="ARE_YOU_SERIOUS">Check it</button>
<p id="Place Holder"></p>
<script>
function ARE_YOU_SERIOUS()
var x = document.getElementbyId("Number").value
document.getElementbyId("Place_Holder").innerhtml = SQUARE ROOT(x)
</script>
I do not want to calculate the square root of x, I just want to print a square root that will contain x in a specific placeholder
html math styles
html math styles
edited Nov 17 at 22:01
asked Nov 17 at 21:17
Alex Carlson
426
426
Provide a Minimal, Complete, and Verifiable example
– LGSon
Nov 17 at 21:29
How much more basic do you want me to get, I just want to print a sqrt(x) as a sqrt(x) with the radical and the x inside of it, but I will try to make a minimal code
– Alex Carlson
Nov 17 at 21:35
So we understand what it is you ask. Anddocument.getElementbyId("Number").value
return the input value as astring
, not anumber
, so you might want to do e.g.SQUARE ROOT(parseInt(x))
– LGSon
Nov 17 at 21:43
I have added a image of 2 different EXAMPLES of what I would like to see after running the script
– Alex Carlson
Nov 17 at 21:50
1
You can't do this with just Unicode characters, you need something like MathML. See for example this question and its answers.
– James K Polk
Nov 18 at 0:51
|
show 2 more comments
Provide a Minimal, Complete, and Verifiable example
– LGSon
Nov 17 at 21:29
How much more basic do you want me to get, I just want to print a sqrt(x) as a sqrt(x) with the radical and the x inside of it, but I will try to make a minimal code
– Alex Carlson
Nov 17 at 21:35
So we understand what it is you ask. Anddocument.getElementbyId("Number").value
return the input value as astring
, not anumber
, so you might want to do e.g.SQUARE ROOT(parseInt(x))
– LGSon
Nov 17 at 21:43
I have added a image of 2 different EXAMPLES of what I would like to see after running the script
– Alex Carlson
Nov 17 at 21:50
1
You can't do this with just Unicode characters, you need something like MathML. See for example this question and its answers.
– James K Polk
Nov 18 at 0:51
Provide a Minimal, Complete, and Verifiable example
– LGSon
Nov 17 at 21:29
Provide a Minimal, Complete, and Verifiable example
– LGSon
Nov 17 at 21:29
How much more basic do you want me to get, I just want to print a sqrt(x) as a sqrt(x) with the radical and the x inside of it, but I will try to make a minimal code
– Alex Carlson
Nov 17 at 21:35
How much more basic do you want me to get, I just want to print a sqrt(x) as a sqrt(x) with the radical and the x inside of it, but I will try to make a minimal code
– Alex Carlson
Nov 17 at 21:35
So we understand what it is you ask. And
document.getElementbyId("Number").value
return the input value as a string
, not a number
, so you might want to do e.g. SQUARE ROOT(parseInt(x))
– LGSon
Nov 17 at 21:43
So we understand what it is you ask. And
document.getElementbyId("Number").value
return the input value as a string
, not a number
, so you might want to do e.g. SQUARE ROOT(parseInt(x))
– LGSon
Nov 17 at 21:43
I have added a image of 2 different EXAMPLES of what I would like to see after running the script
– Alex Carlson
Nov 17 at 21:50
I have added a image of 2 different EXAMPLES of what I would like to see after running the script
– Alex Carlson
Nov 17 at 21:50
1
1
You can't do this with just Unicode characters, you need something like MathML. See for example this question and its answers.
– James K Polk
Nov 18 at 0:51
You can't do this with just Unicode characters, you need something like MathML. See for example this question and its answers.
– James K Polk
Nov 18 at 0:51
|
show 2 more comments
2 Answers
2
active
oldest
votes
up vote
0
down vote
So after doing a wider range of testing on my series of coding, I realized that one of the only ways I could do what I wanted efficiently is to incorporate a library like MathJax. I ended up not getting the squareroot answer that I wanted right away because of line break issues and formatting but overall, mathjax fixed a significant amount of the pain I was feeling.
MathJAX does do radicals in the manner written it just takes some time.
add a comment |
up vote
-2
down vote
<script>
var x = document.getElementbyId("Number").value;
document.getElementbyId("Place_Holder").innerhtml = Math.sqrt(x);
</script>
Im not sure that this will give me a "Square Root of x" with the x inside of a square root.
– Alex Carlson
Nov 17 at 21:29
3
Don't just drop a code w/o explanation, and the code you posted won't work.
– LGSon
Nov 17 at 21:45
please explain your code. code-only answers are not necessarily easy for everyone to understand.
– Harsha B
Nov 19 at 5:50
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53355670%2fafter-inputing-a-value-into-a-input-out-a-string-with-the-radical-value%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
So after doing a wider range of testing on my series of coding, I realized that one of the only ways I could do what I wanted efficiently is to incorporate a library like MathJax. I ended up not getting the squareroot answer that I wanted right away because of line break issues and formatting but overall, mathjax fixed a significant amount of the pain I was feeling.
MathJAX does do radicals in the manner written it just takes some time.
add a comment |
up vote
0
down vote
So after doing a wider range of testing on my series of coding, I realized that one of the only ways I could do what I wanted efficiently is to incorporate a library like MathJax. I ended up not getting the squareroot answer that I wanted right away because of line break issues and formatting but overall, mathjax fixed a significant amount of the pain I was feeling.
MathJAX does do radicals in the manner written it just takes some time.
add a comment |
up vote
0
down vote
up vote
0
down vote
So after doing a wider range of testing on my series of coding, I realized that one of the only ways I could do what I wanted efficiently is to incorporate a library like MathJax. I ended up not getting the squareroot answer that I wanted right away because of line break issues and formatting but overall, mathjax fixed a significant amount of the pain I was feeling.
MathJAX does do radicals in the manner written it just takes some time.
So after doing a wider range of testing on my series of coding, I realized that one of the only ways I could do what I wanted efficiently is to incorporate a library like MathJax. I ended up not getting the squareroot answer that I wanted right away because of line break issues and formatting but overall, mathjax fixed a significant amount of the pain I was feeling.
MathJAX does do radicals in the manner written it just takes some time.
answered Nov 19 at 23:45
Alex Carlson
426
426
add a comment |
add a comment |
up vote
-2
down vote
<script>
var x = document.getElementbyId("Number").value;
document.getElementbyId("Place_Holder").innerhtml = Math.sqrt(x);
</script>
Im not sure that this will give me a "Square Root of x" with the x inside of a square root.
– Alex Carlson
Nov 17 at 21:29
3
Don't just drop a code w/o explanation, and the code you posted won't work.
– LGSon
Nov 17 at 21:45
please explain your code. code-only answers are not necessarily easy for everyone to understand.
– Harsha B
Nov 19 at 5:50
add a comment |
up vote
-2
down vote
<script>
var x = document.getElementbyId("Number").value;
document.getElementbyId("Place_Holder").innerhtml = Math.sqrt(x);
</script>
Im not sure that this will give me a "Square Root of x" with the x inside of a square root.
– Alex Carlson
Nov 17 at 21:29
3
Don't just drop a code w/o explanation, and the code you posted won't work.
– LGSon
Nov 17 at 21:45
please explain your code. code-only answers are not necessarily easy for everyone to understand.
– Harsha B
Nov 19 at 5:50
add a comment |
up vote
-2
down vote
up vote
-2
down vote
<script>
var x = document.getElementbyId("Number").value;
document.getElementbyId("Place_Holder").innerhtml = Math.sqrt(x);
</script>
<script>
var x = document.getElementbyId("Number").value;
document.getElementbyId("Place_Holder").innerhtml = Math.sqrt(x);
</script>
<script>
var x = document.getElementbyId("Number").value;
document.getElementbyId("Place_Holder").innerhtml = Math.sqrt(x);
</script>
<script>
var x = document.getElementbyId("Number").value;
document.getElementbyId("Place_Holder").innerhtml = Math.sqrt(x);
</script>
edited Nov 17 at 21:30
answered Nov 17 at 21:26
Andrei Dunets
12
12
Im not sure that this will give me a "Square Root of x" with the x inside of a square root.
– Alex Carlson
Nov 17 at 21:29
3
Don't just drop a code w/o explanation, and the code you posted won't work.
– LGSon
Nov 17 at 21:45
please explain your code. code-only answers are not necessarily easy for everyone to understand.
– Harsha B
Nov 19 at 5:50
add a comment |
Im not sure that this will give me a "Square Root of x" with the x inside of a square root.
– Alex Carlson
Nov 17 at 21:29
3
Don't just drop a code w/o explanation, and the code you posted won't work.
– LGSon
Nov 17 at 21:45
please explain your code. code-only answers are not necessarily easy for everyone to understand.
– Harsha B
Nov 19 at 5:50
Im not sure that this will give me a "Square Root of x" with the x inside of a square root.
– Alex Carlson
Nov 17 at 21:29
Im not sure that this will give me a "Square Root of x" with the x inside of a square root.
– Alex Carlson
Nov 17 at 21:29
3
3
Don't just drop a code w/o explanation, and the code you posted won't work.
– LGSon
Nov 17 at 21:45
Don't just drop a code w/o explanation, and the code you posted won't work.
– LGSon
Nov 17 at 21:45
please explain your code. code-only answers are not necessarily easy for everyone to understand.
– Harsha B
Nov 19 at 5:50
please explain your code. code-only answers are not necessarily easy for everyone to understand.
– Harsha B
Nov 19 at 5:50
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53355670%2fafter-inputing-a-value-into-a-input-out-a-string-with-the-radical-value%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Provide a Minimal, Complete, and Verifiable example
– LGSon
Nov 17 at 21:29
How much more basic do you want me to get, I just want to print a sqrt(x) as a sqrt(x) with the radical and the x inside of it, but I will try to make a minimal code
– Alex Carlson
Nov 17 at 21:35
So we understand what it is you ask. And
document.getElementbyId("Number").value
return the input value as astring
, not anumber
, so you might want to do e.g.SQUARE ROOT(parseInt(x))
– LGSon
Nov 17 at 21:43
I have added a image of 2 different EXAMPLES of what I would like to see after running the script
– Alex Carlson
Nov 17 at 21:50
1
You can't do this with just Unicode characters, you need something like MathML. See for example this question and its answers.
– James K Polk
Nov 18 at 0:51