+ 1
Can anyone please tell me why this code is not working
This Is a html code for form in which when we click button we jump to a website but in my code i cannot do that can any one give me solved code https://code.sololearn.com/Wl6HU4pVZtOW/?ref=app https://code.sololearn.com/Wl6HU4pVZtOW/?ref=app https://code.sololearn.com/WoRO9S6ttVN9/?ref=app https://code.sololearn.com/Wl6HU4pVZtOW/?ref=app https://code.sololearn.com/Wl6HU4pVZtOW/?ref=app
8 Respuestas
+ 4
You have onEclick in the attributes of your button.
+ 4
KARTIK Patel ,
According to your code, few errors are present..
For fix the error..
`src` is wrong attribute. Src is used the specify source URL i.e(location)for external resources..
Such as images,video,script..
For button behavior you can use(JavaScript)`window.location.href` for define location instead of `button.src`.
second.. correct the spelling `onclick`.
+ 1
Sorry I uploaded an image slider code by mistake just ignore it
+ 1
Can you give me it's solved version
+ 1
For CSS:
* {
/*Changes all the tags styles*/
padding:0;
margin:0;
box-sizing:border-box ;
margin:5px 0;
}
h1 {
/*heading 1 change color*/
color:pink;
}
body {
/*changes made in body tag will effect the whole page*/
text-align:center ;
margin-top:50%;
padding:10px;
background:green;
}
select {
/*stylimg the select tag*/
width:100%;
background:red;
color:pink;
border:none;
outline:2px solid blue;
}
.btn {
/*Custom style for a button look*/
margin-top:10px;
padding:10px;
background:darkgreen;
}
.btn:hover {
background:red;
color:cyan;
}
a {
/*changing the a tag which can link pages*/
text-decoration:none;
color:pink;
display:block ;
}
0
Hey you can try this 😊
I have made a solution for you 😊
And if you need help then you can DM me or ask me any questions if you have problems with your code 😊
You can copy my code here 😊
0
For HTML:
<!DOCTYPE html>
<html>
<!--The hewd tag is not for displaying contents in HTML, It is used for Hidden information about the web page-->
<head>
<!--Add your web page name to the title tag-->
<title>Dare To Solve</title>
</head>
<body>
<!--All the tags which contains content should be in the body tag-->
<h1>Who Are You</h1>
<select>
<option>Male</option>
<option>Female</option>
<option>Animal</option>
<option>alien</option>
<option>Dont Wanna Tell (Because you dont know who are you)</option>
</select>
<a class="btn" href="https://bard.google.com/?hl=en_GB">submit</a>
<!--<button oneclick = "button.src"="https://bard.google.com/?hl=en_GB">sumbit</button> -->
</body>
</html>
0
See I have commented everything for you 😊
Now you can explore new things and yeah if you don't understand them then I will let you explain 😊