+ 1
How i can create a button in html
Help...
5 Answers
+ 8
<Button type="submit">send</button>
+ 4
Using submit input
<input type="submit" value="send" onclick="yourFunction()" >
And some script
<script type="text/javascript">
function yourFunction() {
// do something ...
}
</script>
Using button
<button onclick="yourFunction()" >send</button>
<script type="text/javascript">
function yourFunction() {
// do something ...
}
</script>
or even create button yourself using div
<div class="btn" onclick="yourFunction()">send</div>
And some css
<style type="text/css">
.btn {
display: inline-block;
padding: 2px 3px;
background-color: #bbb;
}
</style>
The main thing is the script
<script type="text/javascript">
function yourFunction() {
// do something ...
}
</script>
+ 3
<button> Click Me </button>
https://www.sololearn.com/Discuss/252937/?ref=app
https://www.sololearn.com/Discuss/91758/?ref=app
https://www.sololearn.com/Discuss/1095344/?ref=app
https://www.sololearn.com/Discuss/1269627/?ref=app
https://www.sololearn.com/Discuss/1284050/?ref=app
https://www.sololearn.com/Discuss/274406/?ref=app
There are already similar (if not identical) questions posted, such as the one(s) above. You can find the answers using the search bar.
Please help keep the quality of posts high in this section of the forum, SoloLearn servers uncluttered, and app latency low by reviewing the following:
https://www.sololearn.com/Blog/38/8-simple-rules-to-get-help-from-the-community/
Happy coding!
0
<button></button>
0
<Button type="submit">send</button>