/    Sign up×
Community /Pin to ProfileBookmark

Need help to print *$% charactors

Hello guys i need some help in javascript regarding print some symbol
i want to use loop but i dont know what loop should i use i need output like – if number is 5 or fewer use a specific symbol and specific color –>%%%
-if number is 6-10 use a different symbol and different color–>###
-if number is 11-20 use a different symbol and different color–>$$$
-if number is above 20 use a different symbol and different color–>***

out put want to look like this
3 —> %%%
7 —>#######
13—> $$$$$$$$$$$$$ … and so on

Thank you for your time and help

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@jay11authorJul 16.2008 — <?xml version = "1.0" encoding = "utf-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!-- Fig. 6.17: welcome6.html -->

<!-- Using equality and relational operators. -->

<html xmlns = "http://www.w3.org/1999/xhtml">

<head>

<title>Using Relational Operators</title>

<script type = "text/javascript">

<!--

var logic;

logic = window.prompt ("Enter number below 5");

if (number <= 5)

document.writeln("%%%%");

else

document.wirteln("please enter number below 5");

if (number <=10)

document.writeln("####");

else

document.wirteln("please enter number below 10");

if (number <= 15)

document.writeln("$$$$");

else

document.wirteln("please enter number below 15");

if (number <= 25)

document.writeln("****");

else

document.wirteln("please enter number below 25");


-->

</script>

<body>

</body>

</html>
×

Success!

Help @jay11 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...