Hello friends, I'm new here ... and I do not speak English, so translating this through google ..... Let's go to the problem ....
I have two inputs, input1 and input2, what I want is that both have input in its box a color value = "0".
If I select input1 in case it should automatically clear the default value and I can enter my once done, select it from the box input2 to enter other information ....
Once selected case input1 and delete the default value, if anything will select box input2 (before introducing anything input1) input1 will need to regain the value of 0 ....
I know the time it takes "focus" and loses "focus", comparing the values of the box is that you detect.
This link is an example of what I want, because from this forum I got some suggestions, but do not quite make the code well
http://jsfiddle.net/ZrSxW/
Here's the code I did, and I know where I'm wrong, download the code from here jquery-2.1.1 which keep it in a file with. Jquery.js js and call, this is in the same folder html file that I discuss What can I do?
I hope I explained well and I hope you help me
Thank you.
<html>
<head>
<title></title>
<script src="jquery.js" type="text/javascript"></script>
<script>
jQuery(function($){
$(document).ready(function(){
input type="text" value="0"
});
$('input').focus(function(){
if($(this).val() == 0) $(this).val('');
}).blur(function(){
if($(this).val() == '') $(this).val(0);
});
</script>
</head>
<body>
<input type="text" value="0">
<input type="text" value="0">
</body>
</html>