HTML DOM insertAdjacentHTML Method

AmitDiwan
Updated on 30-Jul-2019 22:30:26

294 Views

The HTML DOM insertAdjacentHTML() method inserts text string as HTML at a specified position.SyntaxFollowing is the syntax −Calling insertAdjacentHTML() with parameters of positionString and HTML codenode.insertAdjacentHTML(“positionString”, “htmlString”)Position StringsHere, “positionString” can be the following −positionStringDescriptionafterbeginIt inserts htmlString after the beginning of node elementafterendIt inserts htmlString after the node elementbeforebeginIt inserts htmlString before the node elementbeforeendIt inserts htmlString before the end of node elementHtml Stringsand, “htmlString” can be the following −positionStringnew span or This is a new paragraphor any other valid html codeExampleLet us see an example for InsertAdjacentHTML() method − Live Demo insertAdjacentHTML()    form {       ... Read More

Validate Expiry Date on a MySQL Query

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

2K+ Views

You can use NOW() for this. Following is the syntax −select * from yourTableName where yourColumnName> now();Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    expiryDateOfMedicine datetime    ); Query OK, 0 rows affected (0.55 sec)Insert records in the table using insert command −mysql> insert into DemoTable(expiryDateOfMedicine) values('2019-04-27 11:29:00'); Query OK, 1 row affected (0.36 sec) mysql> insert into DemoTable(expiryDateOfMedicine) values('2019-04-26 10:39:21'); Query OK, 1 row affected (0.41 sec) mysql> insert into DemoTable(expiryDateOfMedicine) values('2019-04-28 11:30:10'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(expiryDateOfMedicine) values('2019-04-29 12:44:11'); ... Read More

Find All Columns with Name Length Greater Than 5 in MySQL

Anvi Jain
Updated on 30-Jul-2019 22:30:26

158 Views

Use HAVING to find all columns where the column name length is greater than 5. This will produce the following output −+-------------------+-------------------------+ | TABLE_NAME        | COLUMN_NAME             | +-------------------+-------------------------+ | DemoTable         | UserId                  | | DemoTable         | EndDate                 | | DemoTable         | StartDate               | | DemoTable         | StudentFavouriteSubject | | DemoTable     ... Read More

Print Table of Input Integer in 8086

Chandu yadav
Updated on 30-Jul-2019 22:30:26

717 Views

In this program we will see how to generate table of an integer.Problem StatementWrite 8086 Assembly language program to generate a table of input integer. The number is stored at 500H, and the table will be stored at 600 onwards.DiscussionTable generation is basically the multiplication table creation. We are taking the number and initialize the counter as 0. In each step increasing the counter by 1, and multiply it with the number, then store it into the memory address. When counter becomes 0A (10 in decimal), then it stops.InputAddressData……5004…… Flow Diagram ProgramOutputAddressData……60004601086020C6031060414605186061C607206082460928……         

8254 Control Word and Operating Modes

Chandu yadav
Updated on 30-Jul-2019 22:30:26

7K+ Views

Here we will see the control words and the operation modes of the 8254 programmable interval timer chip.Before discussing its operating modes and control word properties, we should know about some important facts of this chip.When the chip is powering up, the state is undefined. The mode, count value, and outputs are undefined in that time.Each counter must be programmed before it is used. We do not need to program some unused counters.Counters are programmed by writing the control words and then one initial count.The structure of the counter is like this -76543210SC1SC0RW1RW2M2M1M0BCD/Binary We can select the counter by the SC1 ... Read More

HTML DOM Object Type Property

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

178 Views

The HTML DOM Object type Property is used to set or return the value of the type attribute of an object. However, the type attribute is used to set the media type like the object.Following is the syntax to set the type property −obj.type = type_of_mediaAbove, type_of_media is the standard media type, for example, image/bmp, image/tiff, image/tff, etc.Following is the syntax to return the type property −obj.typeLet us now see an example to implement the DOM Object type property −Example Live Demo Display the media type function display() {    var x = document.getElementById("obj").type;     ... Read More

HTML DOM Input Datetime Autofocus Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

141 Views

The HTML DOM Input Datetime autofocus property sets/returns whether Input Datetime is focused upon initial page load.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDatetimeObject.autofocusSetting autofocus to booleanValueinputDatetimeObject.autofocus = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that input will be autofocused on page load.falseIt is the default value and input is not autofocused.ExampleLet us see an example of Input Datetime autofocus property − Live Demo Input Datetime Autofocus Date & Time: Remove Auto Focus    var divDisplay = document.getElementById("divDisplay");    var inputDatetime = document.getElementById("Datetime");    divDisplay.textContent = 'Autofocus: '+inputDatetime.autofocus function removeAutoFocus() { ... Read More

Generate 6-Digit Random Number in MySQL

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

2K+ Views

You can use LPAD() along with rand() and floor() to generate 6-digit random number. Let us first create a table −mysql> create table DemoTable    (    Value int    ); Query OK, 0 rows affected (0.64 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(1); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(2); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(3); Query OK, 1 row affected (0.24 sec) mysql> insert into DemoTable values(4); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(5); Query OK, ... Read More

Java DatabaseMetaData getTables Method with Example

Arushi
Updated on 30-Jul-2019 22:30:26

4K+ Views

This method retrieves the description of the tables available in the specified database/catalog. It accepts 4 parameters −catalog   − A string parameter representing the name (or, name pattern) of the catalog (database in general) in which the table (that contains the columns of which you need to retrieve the description about) exists. pass "" to get the description of the columns in tables with no catalog and, pass null if you don't want to use catalog and thus narrow the search.schemaPattern  − A String parameter representing the name (or, name pattern) of the schema of the table, pass "" ... Read More

Lower Case Column Names with MySQL SELECT

Smita Kapse
Updated on 30-Jul-2019 22:30:26

854 Views

Let us first create a table −mysql> create table DemoTable    (    UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    UserFirstName varchar(20),    UserLastName varchar(20),    UserAge int,    UserCountryName varchar(20)    ); Query OK, 0 rows affected (0.27 sec)Now check the description of table.mysql> desc DemoTable;This will produce the following output −+-----------------+-------------+------+-----+---------+----------------+ | Field           | Type        | Null | Key | Default | Extra | +-----------------+-------------+------+-----+---------+----------------+ | UserId          | int(11)     | NO   | PRI ... Read More

Advertisements