JAVASCRIPT
JAVASCRIPT
Output
{ name: 'Sourav', age: 23, job: 'Developer' }
console.log(obj);
Output
{ name: 'Sourav', age: 23, job: 'Developer' }
DHTML stands for Dynamic HTML. Dynamic means that the content of
the web page can be customized or changed according to user inputs i.e.
a page that is interactive with the user. In earlier times, HTML was used to
create a static page. It only defined the structure of the content that was
displayed on the page. With the help of CSS, we can beautify the HTML
page by changing various properties like text size, background color, etc.
The HTML and CSS could manage to navigate between static pages but
couldn’t do anything else. If 1000 users view a page that had their
information for eg. Admit card then there was a problem because 1000
static pages for this application build to work. As the number of users
increases, the problem also increases, and at some point, it becomes
impossible to handle this problem. To overcome this problem, DHTML
came into existence. DHTML included JavaScript along with HTML and
CSS to make the page dynamic. This combo made the web pages
dynamic and eliminated the problem of creating static pages for each
user. To integrate JavaScript into HTML, a Document Object Model(DOM)
is made for the HTML document. In DOM, the document is represented as
nodes and objects which are accessed by different languages like
JavaScript to manipulate the document.
DHTML JavaScript
<h1>
GeeksforGeeks
</h1>
<p id = "geeks">
Hello Geeks!
</p>
<script>
document.getElementById("geeks").innerHTML =
</script>
Output:
Java Applets was once a very popular feature of web applications. Java
Applets were small programs written in Java that ran inside a web
browser. Learning about Applet helps us understand how Java has
evolved and how it handles graphics.
Note: java.applet package has been deprecated in Java 9 and later
versions, as applets are no longer widely used on the web.
Java Applets
A Java Applet is a Java program that runs inside a web browser. An
Applet is embedded in an HTML file using <applet> or <objects> tags.
Applets are used to make the website more dynamic and entertaining.
Applets are executed in a sandbox for security, restricting access to local
system resources.
Key Points:
Applet Basics: Every applet is a child/subclass of the
java.applet.Applet class.
Not Standalone: Applets don’t run on their own like regular Java
programs. They need a web browser or a special tool called the applet
viewer (which comes with Java).
No main() Method: Applets don’t start with main() method.
Display Output: Applets don’t use System.out.prinln() for displaying
the output, instead they use graphics methods like drawString() from
the AWT (Abstract Window ToolKit) .
Java Applet Life Cycle
The below diagram demonstrates the life cycle of Java Applet:
AWT (Abstract Window Toolkit) is not used in JavaScript — it's a part of Java, specifically for creating
graphical user interfaces (GUIs) in desktop applications. JavaScript, on the other hand, is used
primarily in web development for creating interactive web pages. However, if you're looking for
JavaScript equivalents to AWT-style GUI programming, here's how the comparison works: