Where would i put the on.

 
Malinky: Baako: jsfiddle just doesnt include it like that, also https://jsfiddle.net/zbcys98a/

Albracht: Mayrant, try it for jquery 2.1.3

Kotyk: Https://jsfiddle.net/zbcys98a/1/

Cunnane: I dont know whats going on

Malinky: Uh its seems to be working, what is the problem again?

Malinky: Https://jsfiddle.net/zbcys98a/2/

Malinky: Ronald245: do you mean divs that contain script tags?

Cianfrini: This is my code : div style=”width:100px;height:360px;border:1px solid #000;” button type=”button”Change Lights /button svg height=”100″ width=”100″ circle cx=”50″ cy=”50″ r=”40″ stroke=”black” stroke-width=”4″ fill=”red” / /svg svg height=”100″ width=”100″ circle cx=”50″ cy=”50″ r=”40″ stroke=”black” stroke-width=”4″ fill=”yellow” / /svg svg height=”100″ width=”100″ circle cx=”50″ cy=”

Ihm: Please don’t paste code in the chatroom

Ihm: Make a fiddle or pastie or something

Malinky: Put your code in the corresponding boxes then hit save

Cianfrini: Div style=”width:100px;height:360px;border:1px solid #000;” button type=”button”Change Lights /button svg height=”100″ width=”100″ circle cx=”50″ cy=”50″ r=”40″ stroke=”black” stroke-width=”4″ fill=”red” / /svg svg height=”100″ width=”100″ circle cx=”50″ cy=”50″ r=”40″ stroke=”black” stroke-width=”4″ fill=”yellow” / /svg svg height=”100″ width=”100″ circle cx=”50″ cy=”50″ r=”40″ stroke

Malinky: Put it in a jsfiddle then we can better help you so we dont have to sift thru word wrapped code

Ihm: And we ask for working examples of the problem

Cianfrini: Script async src=”//jsfiddle.net/phf17n8x/embed/”/script

Cianfrini: I can’t do the function

Malinky: Http://jsfiddle.net/phf17n8x/1/

Cianfrini: I need to make the button work the traffic light

Cianfrini: This is what i tried to do

Cianfrini: Script async src=”//jsfiddle.net/jspatel/3y9bqrhc/embed/”/script

Ihm: But besides that. there is no logic that you’ve provided, just the markup

Cianfrini: When i click the button the light will first go red

Cianfrini: Then yellow and then green

Cianfrini: I need to make it as asimple as possible

Cianfrini: Ive never done computing before

Malinky: You should take a look at learn.jquery.com then

Malinky: But in regards to your problem, your binding on the lights themselves, not the button

Ihm: Put an id or a cl*** on the button and bind to that

Ihm: And keep state of what light is currently shown to know what change you need to do

Cianfrini: Script async src=”//jsfiddle.net/phf17n8x/embed/”/script i did the id

Ihm: Why do you keep linking that

Cianfrini: Https://jsfiddle.net/phf17n8x/

Ihm: And you put the markup back in the javascript block

Ihm: It needs to be in the block labeled “HTML”

Cianfrini: Https://jsfiddle.net/phf17n8x/2/

Ihm: Ok, i see the id, but it’s on a circle, not the button

Cianfrini: I know im really like annoying and stuff but thanks for the help

Ihm: And your js isn’t included with that fiddle

Cianfrini: Okay i need to make the id on the button ohh yhh i get it

Cianfrini: But where in the button code would it put it ?

Ihm: Input type=”button” id=”someId”

Cianfrini: Https://jsfiddle.net/phf17n8x/4/

Ihm: You have tf1 repeated on the button and first circle. ids can’t be repeated

Ihm: But other than that, yeah, so do your logic based off the clicking of the button

Cianfrini: Now i have to do on click “tf1” change to trasnparent and “tf2” to yellow

Cianfrini: Oh this is the id for the BUTTON

Cianfrini: Where would i put the on click and change “tf1” to “red”