...

View Full Version : Javascript or html



aspdude2004
06-03-2004, 11:51 PM
Me and my friend were having a debate,

is this javascript or html



onclick="alert('some text here')"


that was used in a input type area of a form

i believe it is javascript as it is a javascript command! please prove him wrong mwahahahaha

A1ien51
06-04-2004, 03:28 AM
If you want to prove it, disable Javascript on the browser and see if it runs....I bet it will not run

DooM_MonkeY
06-04-2004, 04:22 AM
Me and my friend were having a debate,

is this javascript or html



onclick="alert('some text here')"


that was used in a input type area of a form

i believe it is javascript as it is a javascript command! please prove him wrong mwahahahaha

hey ur thirteen 2? so am I, can i see one of your sites?

aspdude2004
06-05-2004, 01:05 PM
yea im currently working on a php site, but the only one working at the mo is

Click Here (http://tig.deathdragon.net)

flare1028us
06-05-2004, 11:30 PM
omg im 13 too.

Yeah, thats definetly JavaScript.

Tails
06-06-2004, 01:58 AM
onclick is an event. An event like this is an attribute that can be used on almost any tag. They allow you to assign javascript statements to them, bridging the gap between HTML and javascript. Please use the PM system for personal conversations and greetings that are don't contribute to the topic.

liorean
06-06-2004, 02:47 AM
Me and my friend were having a debate, is this javascript or html



onclick="alert('some text here')"
Well, it's both. onclick is an HTML attribute name, and the string "alert('some text here')" is an HTML attribute value, that together forms an attribute.

The onclick attribute happens to be an eventhandler attribute. That means that it will be sent to the default scripting engine for parsing. The default scripting engine would for most pages be JavaScript.

The actual content of the attribute value string is then parsed by the JavaScript engine as a function body, and is thus JavaScript. The triggering of the event is a user interaction that is neither HTML nor JavaScript. However, it in turn calls the scripting engine, which will execute the JavaScript function body created from the HTML attribute value.

If you turn scripting off, you only remove the JavaScript part. The event will still happen, but no code will be parsed as the scripting engine is disabled.


So, I'm, afraid the correct answer is that you're both right.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum