Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

How to move button in the same line with Checkbox and Textbox using JavaScript ?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The style “display” property in HTML DOM is used to set elements to the “display” property. To set the button in the same line as other elements of the web page is done using the inline property. 

Syntax:

It returns the “display” property.

object.style.display

It sets the “display” property.

object.style.display = inline;

Example: In this example, the press button will be placed in the same in the same line as of checkboxes on clicking it.

html




<body>
    <script>
        function myGeeks() {
            document.getElementById("GFG")
                .style.display = "inline";
        }
    </script>
      
    <div id="GFG">
        <input type="checkbox" checked> computer
        <input type="checkbox"> mobile
      
        <input type="text">
    </div>
      
    <button onclick="myGeeks()">
        Press
    </button>
</body>

Output:

move button in the same line with Checkbox and Textbox using JavaScript

move button in the same line with Checkbox and Textbox using JavaScript

My Personal Notes arrow_drop_up
Last Updated : 25 Jan, 2023
Like Article
Save Article
Similar Reads
Related Tutorials