answersLogoWhite

0


Best Answer

Assuming your textboxes' "name" attribute is "txt1" and "txt2" respectively, the code would be:

function swap(){

var temp = document.txt1.value;

document.txt1.value = document.txt2.value;

document.txt2.value = temp;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write down the Javascript code to swap the contents?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Java script is best than other language?

Javascript is useful for coding dynamic webpages. It allows you to make and interpret cookies, make simple animation, make pull down menus, and more. Javascript is used to add more power to HTML, which makes it very useful for webmasters to learn.


What is jQuery?

JQuery is a Javascript library that helps create fancy stuff, such as clickable tabs, or animated graphics, on a web page. A plugin created using JQuery can be downloaded by other users to add the extra functionality to their own sites. (See links below)


What is javascript and how do you turn it on?

JavaScript is a computer scripting language used to make a website more versatile and interactive. Enabling JavaScript varies by browser.Mozilla FirefoxClick the Tools menu, or press Alt+T if you don't see a menu, and select Options \ Content \ Enable JavaScript. When you're finished click on OK to save changes.Internet ExplorerClick the Tools menu \ Internet Options \ Security \ Internet \ Custom Level. Scroll down to the Scripting section and click to Enable JavaScript. Do not choose the Prompt option, since you will be prompted every time a web site tries to use JavaScript. When you're finished click OK and then OK again.SafariGo to Edit \ Preferences \ Security \ Enable JavaScript. When you're finished simply close the window.OperaClick on the Opera button and choose Preferences \ Advanced \ Content \ Enable JavaScript. When you're finished click OK.


How does open source products relate in a programming language?

We have two kinds of programming languages, Open Source and Close Source :) Open Source like javascript and Close Source ":)" like .exe files (Compiled Files) Open Source files like javascript wont be compiled and will be used as it wrote. if you think php is open source or not, i should tell you it's a different thing, the first thing you should be worry about is the security, javascript is open source and open source files are less or even unsecured files, it means everyone can see your source code, they can break down your security easily.. So what you should do? USE SOME ENCIPHER PROGRAM TO MAKE IT HARDER TO BREAK DOWN (it will just make it harder.. not impossible) Close Source (Complied Files) are those that you write an code then it will be complied to something else to be understand by computers, like you write c# codes in Visual Studio and when you want to run it, your codes will be compiled to an exe application, then your computer will be able to run it. Compiled Files is more secure but keep it in mind it don't mean it's unbreakable.. nowdays there are reverse programs out there.. :) Wish i got your question right.. :)


What is the code for mouseover menu in JavaScript?

That would be very complicated to write yourself. Use a prewritten script: http://www.google.com/search?hl=en&lr=&q=javascript+dhtml+drop+down+menu But Javascript dropdown menus and flash menus are really annoying. They are inefficient. They won't work for users of text-only browsers, cell phone browsers, or aural browsers (text-to-speach browsers used by blind people). They aren't search engine friendly. They don't match standards for the GUI of the client's OS. Just don't use them. -DJ Craig Javascript is usually used with html(hyper-text markup lang.). type: onmouseover(:dropdown=true:)onmouseout(:dropdown=false:) *** Another solution would to use a powerful javascript plugin called "jQuery". It's a free resource, and allows you to do incredible things with JavaScript with very little code or experiance. For instance, to create a simple dropdown menu, you would just give an element an ID that you want to use.. for instance <a id="menuPop" href="#">PopMeDown!</a>, with another hidden DIV that is position absolutle below the anchor that has an id like <div id="popMeDown" style="display: none;">Stuff In Menu Here</div>. And then your jQuery would be this simple: $('#menuPop').bind('mouseenter', function(e){ $('#popMeDown').slideDown(); }); $('#menuPop').bind('mouseleave', function(e){ $('#popMeDown').slideUp(); }); It's super easy to create things like this with jQuery, check this out: http://docs.jquery.com/Events/bind - Caleb Convina Web Design and Hosting

Related questions

How do you memorize a code?

you can write it down or use one u will remember


What is bombers secret code?

It's different from file to file. Write down the code they give you and remember it.


What is the code on Arabella Drummond's map say?

i no wat the code says but when i find it out then ill write it down


What if you lose your 10 digit code for kumon cosmic club?

Ask your instructor if you can write down your 10 digit code.


Where do you write down the code for dosh on binweevils?

just go to the normal place mystery codes


How do you enter a friends code in pictochat?

You cannot. You can ask for their friend code and write it down after. Then later when you are playing whatever game that has that friend code, then you can enter it in (if the game allows you to)


How do you solve the code in club penguin?

down right is written code each picture you see has letter write the letter in a per and you will find


Saturn radio code 002?

turn on key and radio, hold program key 2 and 3, number will appear, write it down, press am/fm button another number will show, write it down, take numbers and car vin # to dealer get code.


How do you fix a Dell Inspiron 1501 laptop that goes to a blue screen?

Depends on what the error code is. You'll have to write down the exact code and look it up.. the format for a code is 0x0000000#X or something along those lines. Write down the entire code and Google it and I'm sure that you'll be able to find some results for your particular situation.


What is the cheat code to get a plane in GTA vice city?

its easy write down flying ways then you will get a helicopter


Where can I get a form to get the combination for my safe?

You can take a piece of paper and write your code down then tape to the bottom of your safe


What are horsez codes?

If you want to take your foal to sally to be cured, write down the foals code. Type in the code to get it back, that's the only way you will.