+ 4

🇨🇿 Co jsem udělal špatně v tomto kódu? jedná se o převod do hexadecimální soustavy.

https://code.sololearn.com/WuOXjcv2puk7/?ref=app

23rd Dec 2017, 2:12 PM
Nogard
Nogard - avatar
9 Antworten
+ 3
No problem. Kindly please mark my other answer as best, if you will. That one actually contains the solution to your problem ;)
23rd Dec 2017, 7:56 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 7
Nemluvim cesky, ale anglicky ano :) You have to structure your alert like this: alert(eval(document.getElementById("input").value).toString(16)); Also, in the HTML button declaration you have to call the function by adding the parentheses: ... onClick="PrevoddoCs()" That should help. [EDIT] I couldn't find an error in your code afterwards, so I tried to re-write it, using just the CSS and your element naming. Check it out: https://code.sololearn.com/W2ftxZ8MxNJE/?ref=app
23rd Dec 2017, 3:22 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Ok, I updated my code above to do two things at once. Perhaps you will make some use of this :) document.write will re-create the whole page, like it does in your code -- is that what you want indeed?
23rd Dec 2017, 6:17 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
English?
23rd Dec 2017, 3:05 PM
Lucien
Lucien - avatar
+ 1
Now i'm looking for where i should add .innerHTML. Can u help me with it ?
23rd Dec 2017, 3:52 PM
Nogard
Nogard - avatar
+ 1
Yeah thanks so much !
23rd Dec 2017, 7:21 PM
Nogard
Nogard - avatar
0
Oh thanks so much for answer :D
23rd Dec 2017, 3:32 PM
Nogard
Nogard - avatar
0
Yeah, but i want make it print to same page...
23rd Dec 2017, 5:59 PM
Nogard
Nogard - avatar
0
in same page like where is blue bg and input...
23rd Dec 2017, 6:10 PM
Nogard
Nogard - avatar