Found 9321 Articles for Object Oriented Programming

How to set whether or not an element is resizable by the user with JavaScript?

Shubham Vora
Updated on 26-Oct-2022 12:20:50

327 Views

In this tutorial, we will learn to set whether or not an element is resizable by the user with JavaScript. Use the resize property to set whether the element is resizable by the user or not. The elements on a webpage are fixed on their position and size. But, sometimes, you need to give access to a user to increase the size or change the position of an element. The resize property of CSS gives us a way to change the size of an element. JavaScript DOM nearly provides all the styling properties provided by the CSS. We can even ... Read More

How to set the painting area of the background with JavaScript?

Shubham Vora
Updated on 22-Nov-2022 07:05:10

184 Views

In this tutorial, we will learn how to set the painting area of the background with JavaScript. The task is to define the background painting area. The background-clip property is commonly used to square measure the painting space of any web page's background. It specifies that we will modify the webpage's background regarding its contents or images/videos. The background-clip property specifies whether the background of an element extends beneath its border-box, padding box, or content box. If the element does not have a background image or color, this property has no visual effect unless the border has transparent or partially ... Read More

How to set the right position of a positioned element with JavaScript?

Shubham Vora
Updated on 25-Oct-2022 08:53:35

2K+ Views

In this tutorial, we shall learn to set the right position of a positioned element with JavaScript. What is a positioned element? The available position values in JavaScript are relative, absolute, fixed, or static. The static position is the default position value. Static elements are in the document order. A positioned element's position is based on its properties like the top, right, bottom, and left. We must set the position in every direction to align the elements as required. Here we are going to see the right position property. Let us get deeper into the topic and understand how to ... Read More

How to set the type of positioning method used for an element with JavaScript?

Shubham Vora
Updated on 25-Oct-2022 09:11:49

163 Views

In this tutorial, we shall learn to set the type of positioning method used for an element with JavaScript. The positioning permits us to move elements out of actual document order and make them appear in various ways. For instance, stay on top of one another or occupy the initial position within the browser viewport. Let us understand how to set the type of positioning method. Using the Style position Property With the Style "position" property, we can set or return the type of positioning method used for an element. The available position values are relative, absolute, fixed, sticky, and ... Read More

With JavaScript how to change the width of a table border?

Nitya Raut
Updated on 23-Jun-2020 10:58:32

756 Views

To change the width of a table border, use the DOM border property. You can try to run the following code to change the width of a table border in JavaScript −Example                    function borderFunc(x) {             document.getElementById(x).style.border = "5px dashed blue";          }                                             One             Two                                 Three             Four                                 Five             Six                                          

Difference between static, auto, global and local variable in C++

George John
Updated on 30-Jul-2019 22:30:21

3K+ Views

There are two separate concepts here − scope, which determines where a name can be accessed - global and local storage duration, which determines when a variable is created and destroyed - static and auto Scope Local variables can be used only by statements that are inside that function or block of code. Local variables are not known to functions on their own. Example Live Demo #include using namespace std; int main () { // Local variable declaration: int a, b; int c; // actual initialization a = 10; b = 20; c = a + b; cout

What are local variables and global variables in C++?

Samual Sam
Updated on 11-Feb-2020 09:59:43

8K+ Views

A scope is a region of the program and broadly speaking there are three places, where variables can be declared − Inside a function or a block which is called local variables,  In the definition of function parameters which is called formal parameters. Outside of all functions which are called global variables.Local variables can be used only by statements that are inside that function or block of code. Local variables are not known to functions on their own. Example#include using namespace std; int main () {    // Local variable declaration:    int a, b;    int c;    // actual ... Read More

What are global variables in C++?

Lakshmi Srinivas
Updated on 11-Feb-2020 09:57:02

7K+ Views

Global variables are defined outside of all the functions, usually on top of the program. The global variables will hold their value throughout the lifetime of your program.A global variable can be accessed by any function. That is, a global variable is available for use throughout your entire program after its declaration. Example#include using namespace std; // Global variable declaration: int g; int main () {    // Local variable declaration:    int a, b;    a = 10;    b = 20;    g = a + b;    cout

What are local variables in C++?

karthikeya Boyini
Updated on 11-Feb-2020 09:55:53

315 Views

Variables that are declared inside a function or block are local variables. They can be used only by statements that are inside that function or block of code. Local variables are not known to functions on their own.ExampleLive Demo#include using namespace std; int main () {    int a, b;    int c;    a = 10;    b = 20;    c = a + b;    cout

How many keywords are there in C++?

Rishi Raj
Updated on 30-Jul-2019 22:30:21

4K+ Views

There are a total of 95 reserved words in C++. The reserved words of C++ may be conveniently placed into several groups. In the first group, we put those that were also present in the C programming language and have been carried over into C++. There are 32 of these.There are another 30 reserved words that were not in C, are therefore new to C++There are 11 C++ reserved words that are not essential when the standard ASCII character set is being used, but they have been added to provide more readable alternatives for some of the C++ operators, and ... Read More

Advertisements