Wenn ich Javascript entferne meine Reset-Taste funktioniert gut, aber wenn ich JavaScript laden, funktioniert es nicht mehr. Ich habe auch versucht, Rest-Taste mit jQuery-Funktion. Ich habe auch versucht, mit Eingabe Typ = "Reset" Wert = "Reset" , aber es funktioniert auch nicht. Ich habe alles versucht, was ich jetzt weiß, ich weiß nicht, was ich tun soll.Reset-Taste funktioniert nicht beim Laden JavaScript
Bitte helfen
$(document).ready(function c() {
$("#f").click(function(event){
$("body").toggleClass("hi");
event.preventDefault();
}); \t \t \t
});
$(document).ready(function c1() {
$("body").click(function(event){
$("p").toggleClass("hii");
event.preventDefault();
}); \t \t \t
});
//reset funtion using jquery
/*$(document).ready(function re(){
$("form").click(function(event){
$("#r").reset(); //reset funtion using jquery
}); \t
})*/
body{
font-size: x-large;
}
h2{
color: blue;
}
body.hi{
background:#242424;
color: white;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div align="right"><input type="submit" id="f" name="night mode" value="night mode" onclick="c()" onclick="c1()"></div>
<h2>contact form</h2>
<form action="mailto:[email protected]" method="post" enctype="text/plain">
<label for="company">company's name<br>
<input type="text" id="company" name="company" autocomplete="companyname" placeholder="name" >
</label><br>
<label for="contact_person">contact person<br>
<input type="text" id="contact_person" name="contact person" autocomplete="contact person" placeholder="name">
</label><br>
<label for="email">email <br>
<input type="email" id="email" autocomplete="email" name="email" placeholder="[email protected]"> <br>
<label >Subject</label>
<br>
<textarea name="subject" placeholder="Write something.."></textarea><br>
<button type="submit" value="Submit">Submit</button> reset button
I have also tried using input type="reset" value="Reset"
but it is also not working
<button type="reset" onclick="re()" id="r">Reset</button>
</form>
'Reset funtion mit jquery' - möglicherweise diese Syntaxfehler mit Ihnen schraubt –