[Solved] if window.location.href.indexOf(‘player=1’) add style [closed]

You need to set the style of the body element if the string you are checking for is present in the URL. if(window.location.href.indexOf(“player=1″)!=-1) document.body.style.backgroundColor=”#000”; Alternatively, to avoid setting inline styles, you can create a new class and apply it to the body if the string you are checking for is present. body.player1{ background:#000; } if(window.location.href.indexOf(“player=1”)!=-1) … Read more

[Solved] How to read with JavaScript [closed]

you can use id to get the element you want to style. <!DOCTYPE html> <html> <body> <p id=”myp”>Click the button to change the style of the p element.</p> <button onclick=”myFunction()”>Try it</button> <script> function myFunction() { var color1 = Math.floor((Math.random() * 255) + 1); var color2 = Math.floor((Math.random() * 255) + 1); var color3 = Math.floor((Math.random() … Read more

[Solved] Checkbox and radiobutton won’t show

You have set opacity: 0 for checkboxes and radio buttons in main.css. Remove it and they will appear in your page. opacity sets the transparency of an element. Therefore opacity: 1 means no transparency while opacity: 0 means element having full transparency (invisible on the page). input[type=”checkbox”], input[type=”radio”] { -moz-appearance: none; -ms-appearance: none; appearance: none; … Read more

[Solved] How to change the color of text?

All you need is #post a { color: white; }. (ie, target the a child of the element with id=post) Forked Fiddle. CSS is frustrating, for sure, but there is a method to the madness. I found it’s worth reading articles on MDN when I encounter difficulties. 1 solved How to change the color of … Read more

[Solved] Why does not javascript show the output when button is clicked

Check this. function clicked() { var firstname = document.getElementById(“fname”).value; var lastname = document.getElementById(“lname”).value; document.getElementById(“demo”).innerHTML = “Hello ” + firstname + “<br>” + “Your lat name is: ” + lastname; } <div> First Name: <input type=”text” id=”fname” value=””><br><br> Last Name: <input type=”text” id=”lname” value=””> <button onclick=”clicked()”>Submit</button> <p id=”demo”></p> </div> 2 solved Why does not javascript show … Read more

[Solved] CSS positioning things differently between browsers [closed]

Use position: absolute for links. Example for “May”: position: absolute; left: 220px; top: 226px; z-index: 2; text-decoration: none; font-family: helvetica; font-size: 21px; text-align: center; font-weight: bold; font-stretch: extra-condensed; line-height: 90%; Updated Else use percents instead of pixels. position: absolute; left: 31%; top: 25%; z-index: 2; text-decoration: none; font-family: helvetica; font-size: 21px; text-align: center; font-weight: bold; … Read more

[Solved] How do you inject this code into HTML using Javascript?

var div = document.createElement(“div”); div.setAttribute(“id”, “bar”); div.style.position = “fixed”; div.style.top = “0”; div.style.left = “0”; div.style.height = “50px”; div.style.width = “50px”; div.style.backgroundColor = “#ccc”; document.body.appendChild(div); 0 solved How do you inject this code into HTML using Javascript?

[Solved] background-position y axis issue in mozilla firefox [closed]

Background position values are required to have a unit value for non-zero positions. So if you want the icon to be 4px off the top, change it to: background-position: 0 4px; You can also include the position in the shorthand, like so: background: url(‘icon.png’) 0px 4px no-repeat; 1 solved background-position y axis issue in mozilla … Read more

[Solved] How to change font size inside option of a select box if it has number?

Yo cant individually style elements in options. This element is rendered by the OS, not HTML. It cannot be styled via CSS. There are replacement plug-ins that look like a SELECT, but are actually composed from regular HTML elements that CAN be styled. Use instead https://github.com/HubSpot/select or https://select2.org/ solved How to change font size inside … Read more

[Solved] Allowing user to customize the items on the list menubar

What you’re looking for is possible with vanilla Javascript, jQuery, or a host of other libraries. jQuery is where I’d recommend you start. You can create new elements by passing html elements as strings to the jQuery function. See the “Creating New Elements” section of this page. Using append and remove as Muzammil mentioned, you … Read more

[Solved] Why does this work? (JQuery) [closed]

No. It is a CSS property, passed as literal string, in order to be interpreted as CSS property by jQuery. No. CSS properties are transformed to CamelCase when used in JS. Although jQuery can also take them in the hyphenated form, the author of your example has chosen to camel-case them, so they don’t need … Read more