Tag Archives: HTML
Figcaption Tag HTML5
The <figcaption> element is used to provide a caption to an image. It is an optional tag and can appear before or after the content within the <figure> tag. The <figcaption> element is used with <figure> element and it can be placed as the first or last child of the <figure> element.
Canvas Element HTML5
The <canvas> element is a container that is used to draw graphics on the web page using scripting language like JavaScript. It allows for dynamic and scriptable rendering of 2D shapes and bitmap images. There are several methods in canvas to draw paths, boxes, circles, text and add images
Access HTML Element JavaScript
Here are the ways an HTML element can be accessed in a JavaScript code:
- getElementByClass(‘classname’): Gets all the HTML elements that have the specified classname.
- getElementById(‘idname’): Gets an HTML element by its ID name.
- getElementbyTagName(‘tagname’): Gets all the HTML elements that have the specified tagname.
- querySelector(): Takes CSS style selector and returns the first selected HTML element.
href go to div
<div id="jump">jump to point</div>
Form
Way of collecting data online from user accessing a web site.
Form data automatically available to php scripts. Dots and spaces in variable names converted to underscores.
Form data can be made into an array using the following syntax <input name=”FormArray[]”> .
Group elements by assigning the same array name to different elements; can specify keys.
$_POST superglobal contains all POST data; paired with post method
$_GET superglobal contains all GET data and $_REQUEST is independent of data source, and merges information from sources like GET, POST, and COOKIES; usage is not recommended
loadHTMLFile
The function parses the HTML document in the file named filename. Unlike loading XML, HTML does not have to be well-formed to load.
This function may also be called statically to load and create a DOMDocument object. The static invocation may be used when no DOMDocument properties need to be set prior to loading.
php replace html tags
<?php preg_replace(“/<lis(.+?)>(.+?)</li>/is”, “<span>$2</span>”, $string); ?>
Submitting the form in iframe and redirect the root page
Use target=”_top” as form attribute
popup on hover html
<style>
#hover-text { position:relative; cursor:pointer; }
#hover-text span {
display:none; position:absolute; top:0; left:100px;
z-index:1; width:150px; padding:10px; border:1px solid #ccc;
border-radius:5px; box-shadow:4px 4px 4px #999;
}
#hover-text:hover span { display:block; }
</style>
<div id=”hover-text”>
Site Name
<span>
PHPCodez
</div>