search
[last updated: 2023-12-06]
CSS
HTML: style
-----
This is a LONG way away from anything presentable.
For now it's just a random, mostly unorganized list of things I've learned in my process...
-----------------------------------------------------------------------------------------------------------
<head>
<script>
code here ...
</script>
</head>
If the Javascript code writes page content, then you should put the code in the <body> section,
preferably at the bottom, below all other code.
<head>
<script type="text/javascript" src="script-file1.js"></script>
<script type="text/javascript" src="script-file2.js"></script>
</head>
-------------------------------------------------------------------
<script>
functionName ();
</script>
-------------------------------------------------------------------
var pixelValue = "200.5px";
var pixelNum = parseInt(pixelValue);
this will return "200", ie. without the decimal portion, and without the px units.
-------------------------------------------------------------------
document.getElementById("myDiv")
document.getElementById("myDiv").innerHTML = "some text";
which will put "some text" into the element,
var myDiv = document.getElementById("myDiv");
-------------------------------------------------------------------
function functionName () {
[statements]
}
function functionName ();
-------------------------------------------------------------------
var bluPad = parseFloat(getComputedStyle(blu).[parameterName]);
this returns integer value, without "px" or "%" units,
and works for me for padding, height ...
And it works whether the parameter is defined inline or internal.
-------------------------------------------------------------------
-------------------------------------------------------------------