The autofocus attribute of the element is used to set the autofocus to the textarea itself when the page loads. The autofocus attribute for the element introduced in HTML5.Following is the syntax −Let us now see an example to implement the autofocus attribute of the element −Example Live Demo Interview Questions Why do you want go for the Technical Writer Job Profile? (100 words) Write the answer in 100 words only... What are your strengths? (50 words) Write the answer in 50 words ... Read More
The autofocus attribute of the element is used to specify which of the would get focus when the web page loads. This attribute introduced in HTML5.Following is the syntax −Let us now see an example to implement the autofocus attribute of the element −Example Live Demo Log in to your account Id: Password: DOB: Submit OutputIn the above example, we have created a form − Id: Password: DOB: Submit We have set autofocus to the third input as shown below i.e. DOB, therefore the cursor is visible there itself −DOB:
Definition and UsageThe decoct() function returns a string that contains octal equivalent of given decimal number argument.This function returns a string with octal characters (0 to 7).Syntaxdecoct ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent octal representationReturn ValuesPHP decoct() function returns an octal number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 1001 and returns '1751' −OutputThis will produce following result −decoct(1001) = 1751Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 100.55 is ... Read More
The cols attribute of the element is used to set the width of the textarea. The cols set it and the width is visible under the textarea itself.Following is the syntax −Above, num is the width of the textarea. The default value is 20.Let us now see an example to implement the cols attribute of the element −Example Live Demo Interview Questions Why do you want go for the Editor Job Profile? (100 words) Write the answer in 100 words only... What are your weaknesses? (50 words) ... Read More
Definition and UsageThe dechex() function returns a string that contains hexadecimal equivalent of given decimal number argument.This function returns a string with hexadecimal characters.Syntaxdechex ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent hexadecimal representationReturn ValuesPHP dechex() function returns a hexadecimal number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 1001 and returns '3e9' −OutputThis will produce following result −dechex(1001) = 3e9Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 100.55 is treated as 100 ... Read More
Definition and UsageThe decbin() function returns a string that contains binary equivalent of given decimal number argument.This function returns a string with binary digits.Syntaxdecbin ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent binary representationReturn ValuesPHP decbin() function returns a binary number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 13 and returns '1101' −OutputThis will produce following result −decbin(13) = 1101Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 9.99 is treated as 9 ... Read More
Function chainingFunction chaining is nothing but grouping functions in one single line using dot notation. This type of chaining makes the code very concise and also improves the performance.Here we are going to learn function chaining using regular objects.a) Without function chaining In the following example an object 'obj' is created and in that object a public property called 'i' is created using keyword 'this' and initially assigned a value 0. later on user defined functions called add(), subtract() and print() are created inside the same object 'obj'. Now, the object "obj" will acts like a class(it's properties can be shared by ... Read More
Definition and UsageThe cosh() function returns the hyperbolic cosine ratio of given angle in radians. In trigonometry, hyperbolic cosine ratio is defined as .cosh(x) = (ex – e-x))/2This function returns a float value .Syntaxcosh ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point value that represents angle in radiansReturn ValuesPHP cosh() function returns hyperbolic cosine ratio of given parameter.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates cosh(pi/2) and returns 2.5091784786581 which is also the result of formula (ex + e-x))/2 −OutputThis will produce following result −cosh(M_PI_2) = 2.5091784786581 ... Read More
Definition and UsageThe cos() function returns the cosine ratio of given angle in radians. In trigonometry, cosine of an angle is defined as ratio of lengths of adjacent side and hypotenuse.cos(x) = adjacent/hypotenuseIf x=90 degree, cos(x) = 0.This function returns a float value.Syntaxcos ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point value that represents angle in radiansReturn ValuesPHP cos() function returns cosine ratio of given parameter.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates cos(pi/2) and returns 6.1232339957368E-17 (very close to 0). Cosine ratio of 90 deg is ... Read More
To create rotate out downright animation effect with CSS, you can try to run the following code −ExampleLive Demo .animated { background-image: url(/css/images/logo.png); background-repeat: no-repeat; background-position: left top; padding-top:95px; margin-bottom:60px; -webkit-animation-duration: 10s; animation-duration: 10s; -webkit-animation-fill-mode: both; animation-fill-mode: both; } @-webkit-keyframes rotateOutDownRight { 0% { -webkit-transform-origin: right bottom; -webkit-transform: rotate(0); opacity: 1; } 100% { -webkit-transform-origin: right bottom; -webkit-transform: rotate(-90deg); opacity: 0; } } @keyframes rotateOutDownRight { 0% { transform-origin: right bottom; transform: rotate(0); opacity: 1; } 100% { transform-origin: right bottom; transform: rotate(-90deg); opacity: 0; } } .rotateOutDownRight { -webkit-animation-name: rotateOutDownRight; animation-name: rotateOutDownRight; } Reload page function myFunction() { location.reload(); }