Hi all my name is codingcon and i just joined daniweb :), i am new to the the javascript language and only have the basics down. Ihave this idea that i want to make and i just dont know how to do this one thing. basically i wanna know how to basically make an if statement for when a user clicks a button(In this case a picture) print a character on the screen. I know how to print a character on the screen i jsut dont know how to make the if statment sense the clicking of a picture. Thanks.

Normally you attach something to an event instead of an if statement.
For example:

<img src="image.jpg" onclick="imageClick()" />

<script type="text/javascript">
    function imageClick() {
        // do something

or you could directly do onclick=" *do something *" but I find it better this way.

ahh i see thank you. But the reason i wanted an if statement because i wanted to basically do if the person taps this picture then another picture in a certain pattern then print a charater.

I'm not sure if I understand.
You want to be able to define a path, like if users click picture 1 then click picture 2 do something?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.