Microsoft HTA/CSS and JavaScript: Difference between revisions
Jump to navigation
Jump to search
computernewb>User123 No edit summary |
(No difference)
|
Revision as of 21:50, 9 July 2021
HTA, like HTML, can have CSS and JavaScript. As HTA runs on Internet Explorer, it may not fully support CSS3 and ES6. You can use <style> and <script> tags or inline CSS/JS to use styles and scripts.
Example
Language: HTA
<!DOCTYPE html>
<html>
<head>
<title>Hello, world!</title>
<HTA:APPLICATION
APPLICATIONNAME = "Hello, world!"
/>
<style>
body {
background: red;
color: blue;
text-align: center;
}
</style>
<script>
function helloWorld() {
document.getElementById('demo').innerHTML = 'You clicked it!!';
}
</script>
</head>
<body>
<h1 id="demo" style="background:black;padding:8px">Hello, world!</h1>
<button onclick="helloWorld();">Click me!</button>
</body>
</html>