[Solved] operations with javascript in html document

You are getting NaN because of this: var altezza = document.getElementById(‘altezza’); var base = document.getElementById(‘base’); (base*altezza/2) getElementById() does exactly that – gets the element. You just need to get the value from the element e.g. var altezza = document.getElementById(‘altezza’).value; solved operations with javascript in html document

[Solved] Buat pertunjukan pop up setiap 30 detik berulang

Check if this what you are looking for. I reduced the interval If the modal is already popped you do not need to worry about the timer. setInterval( () => { $(“#myModal”).modal(); }, 10000); <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js”></script> <!– jQuery Modal –> <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js”></script> <link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css” /> <div id=”myModal” class=”modal”> <p>A Modal dialog</p> <a href=”#” rel=”modal:close”>Close</a> … Read more

[Solved] Log out from site [closed]

You should be checking if a session variable exists to grant access to users. To log out from your site, simply destroy the session, this will prevent access effectively ‘logging’ the user out: session_start() session_destroy(); //destroy sessions but session data will still be avail on same page so redirect is needed after this header(‘location:index.php’); // … Read more

[Solved] How to put HTML, CSS and JS in one single file

you cannot save all the file extension into one single file. Css is .css, Javascript is .js. but you can link all those files into your html <link rel=”stylesheet” type=”text/css” href=”https://stackoverflow.com/questions/47306539/yourcssfile.css”> for javascript <script src=”https://stackoverflow.com/questions/47306539/yourjsfile.js”></script> solved How to put HTML, CSS and JS in one single file

[Solved] Click outside of div and more [duplicate]

$(function() { $(‘#loginBtn, #loginArea’).on(‘click’, function(e) { $(‘#loginArea’).show(); e.stopPropagation(); }); $(‘body’).on(‘click’, function() { $(‘#loginArea’).hide(); }); }); If the click is within the login area or on the button, then the event will not make it to the second handler to hide the login area. solved Click outside of div and more [duplicate]

[Solved] is there a goback() for webview? [closed]

Your back button closes the activity because that’s the normal behaviour. What you need to do if you want to use the back button to act as a Go back button for your WebView is: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { yourWebView.goBack(); return true; } return super.onKeyDown(keyCode, event); … Read more

[Solved] How to make a page within a page? [closed]

You sort of answered your own question in the question. The ideal way to do this is with an <iframe>. If an <iframe> is not possible then you can manually ‘scope’ your CSS by prefixing all rules in your ‘frame’ with a certain ID and overriding your default styles: .style1 { … } .style2 { … Read more

[Solved] How Do I Execute btoa(string); using HTML and JS

Javascript has a built in atob and btoa function. <script type=”text/javascript”> function doAtob() { var val = document.getElementById(“inputbox”).value; var out = document.getElementById(“outval”); out.appendChild(document.createTextNode(atob(val))); } </script> <input id=”inputbox” type=textbox /> <button onclick=’doAtob()’>Do it!</button> <span id=”outval” /> solved How Do I Execute btoa(string); using HTML and JS

[Solved] AppendChild Is Not working with textcontent (javascript) [closed]

textContent replaces all the content in the element. http://jsfiddle.net/2nmL7v5b/6/ You have to something like this var infoDiv = document.createElement(“div”); infoDiv.setAttribute(“class”, “text-block”); var bio = document.createElement(“strong”); bio.textContent = “Bio”; infoDiv.appendChild(bio); var spanElem = document.createElement(“div”); spanElem.textContent = “Full”; infoDiv.appendChild(spanElem) document.getElementsByTagName(“body”)[0].appendChild(infoDiv) <body> </body> Or if you don’t want to use span tag you can use innerHTML also like … Read more

[Solved] make div a box element and let it show test on hover

Css class name should start with a character. And use display : inline-block; when you want the width to be fixed to what you set. here is the code example <!DOCTYPE html> <html> <head> <meta charset=”utf-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”description” content=”Mein Projekt zu Australien.”> <link rel=”stylesheet” href=”http://www.w3schools.com/lib/w3.css”> <style> html { background: url(bg.jpg) no-repeat center … Read more

[Solved] How to put CSS and HTML in one page of code? [duplicate]

Here is how you would do it, although I don’t recommend it. It’s far easier to maintain your code by including a style sheet and keeping your markup/CSS separate. <!DOCTYPE html> <!–[if gt IE 8]><!–> <html lang=”en”> <!–<![endif]–><head> <meta charset=”utf-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″> <title>Light Horizontal Navigation</title> <link rel=”stylesheet” href=”https://stackoverflow.com/questions/40642943/css/style.css”> <!–[if lt IE 9]><script src=”https://html5shim.googlecode.com/svn/trunk/html5.js”></script><![endif]–> </head> … Read more

[Solved] Find piece of string inside array and do something if I can find it

Your question still isn’t explained very well, but I think I have it. You’re asking why this returns true: if($(this).html().indexOf(“Title A”) != -1) { //should get here } But this doesn’t: var titles = [“Title A”]; var realTitle = $(this).html(); if (titles.indexOf(realTitle) > -1) { //should get here } The difference has to do with … Read more