css micro
css micro
State the use of dotcent tax in JavaScript with the help of suitable example
function detectBrowser() {
if (userAgent.includes("Firefox")) {
} else if (userAgent.includes("Safari")) {
return "Opera";
} else {
return "Unknown";
<!DOCTYPE html>
<html lang=”en”>
<head>
<title>Prompt() method</title>
</head>
<button onclick=”geek()”>
Click me!
</button>
<p id=”g”></p>
<script>
Function geek() {
“GeeksforGeeks”
);
If (doc != null) {
Document.getElementById(
“g”
).innerHTML =
“Welcome to “ + doc;
}
Q. Write a JavaScript that display all properties of window object explain the code
<!DOCTYPE html>
<html>
<head>
<script language=”JavaScript”>
Function winopen() {
Window.open(https://www.geeksforgeeks.org)
Function showstatus() {
Window.status =
</script>
</head>
<body onload=”showstatus()”>
Value=”Open GeeksforGeeks”
Onclick=”winopen()”>
</body>
</html>
Q. Write a javascript function that check whether passed string is pilndrome or not
function check_palindrome(str) {
let j = str.length - 1;
if (x != y) {
return false;
,,}
return true;
function is_palindrome(str)
if (ans == true) {
else {
Function countVowel(str) {
Return count;
// take input
Console.log(result);
Q. State what is a regular expression explain its meaning with the help of suitable
example
The concept of regular expressions began in the 1950s, when the American
mathematician Stephen Cole Kleene formalized the concept of a regular language. They
came into common use with Unix text-processing
1.Set timeout()
2.setinterval()
Function charToUnicode(char) {
Return char.charCodeAt(0).toString(16).toUpperCase();
Function unicodeToChar(unicode) {
// Examples
Const character2 = ‘ ’;
Q. List with of protecting your web page and describe any one of the
1.SSL/TLS Certificates:
These certificates encrypt the data transmitted between your website and the user’s
browser, preventing eavesdropping and ensuring secure communication.
2.Keep Software Updated:
Regularly update your operating system, web server software, and any plugins or themes
used on your website to patch security vulnerabilities.
Q. Write a function that user for a colour and uses what they select the background
colour of the new web page opened
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
</head>
<body>
<script>
Function setBackgroundColor() {
newWindow.document.body.style.backgroundColor = color;
</script>
</body>