[Solved] Uncaught TypeError: Cannot set property ‘src’ of null while changing SRC of img [closed]

Looking at your code you do: var names = (“1200voc”) then try to access names as an array. So this: for (x = 0; x < names.length; x++) { var prof = document.getElementById(names[x]); prof.src=”https://stackoverflow.com/questions/48342902/engine/images/proffesion/” + names[x] + ‘.png’; } Means that names[0] will return 1, names[1] will return 2, names[2] will return 0 and so … Read more

[Solved] Why is the Touch-Punch plugin not functioning in my website?

So my path to the touch-punch plugin, was incorrect. After finding the correct path to the jquery.ui.touch-punch.min.js file in my CPanel, I changed the path in my code and was able to utilize the touch feature. Also make sure that the type of script is defined. For example: adding the type=text/javascript, was also necessary for … Read more

[Solved] PDO login.php needs help finishing [closed]

The prepare statement returns an object, you can execute that object. Thus $query->execute() – the first parameter of execute can be an array. Alternatively, you can use the bindParam function first on that same $query object instead of passing an array though. Anyways, here you are: <?php if(isset($_POST[‘username’], $_POST[‘password’])){ try{ $username=”root”; $password = ”; $conn … Read more

[Solved] P element doesn’t work as a ‘div’ element?

Add !important to your class to force your selector to work. That is, .alignCenter{text-align: center !important;} See this Fiddle. See Stack Overflow question What is the difference between <p> and <div>? to view the difference between p and div. solved P element doesn’t work as a ‘div’ element?

[Solved] Why is vertical-align:middle not working like text-align:center

The vertical-align attribute is for inline elements only. It will have no effect on block level elements, like a div or a paragraph.If you would like to vertically align an inline element to the middle just use this. Refer this Link : http://phrogz.net/CSS/vertical-align/index.html solved Why is vertical-align:middle not working like text-align:center

[Solved] How to save background color in cookie through button click?

You can do it like this: window.addEventListener(‘DOMContentLoaded’, function() { var cookieValue = getCookie(‘backgroundColor’), btns = document.querySelectorAll(‘.color-btn’); if (cookieValue) { setBackgroundColor(cookieValue); } Array.from(btns).forEach(function(btn) { btn.addEventListener(‘click’, function() { var color = this.getAttribute(‘data-color’); setBackgroundColor(color); }); }); }); function setBackgroundColor(color) { document.body.style.backgroundColor = color; setCookie(‘backgroundColor’, color); } function getCookie(name) { var cookies = document.cookie.split(‘;’), cookie = cookies.find(function(str) { return … Read more

[Solved] php radio buttons submit form issue

You have to add attribute , ” required ” to all the input fields so that an error message will be displayed when one is empty!! To check if the answer is correct, you can use php! $name=$_GET[“name”]; $email=$_GET[“email”]; $ans=$_GET[“ans”]; if($ans==’correct’){ // you can use mail command here header(“location:correct.php”); }else{ header(“location:incorrect.php”); } solved php radio … Read more

[Solved] Html button who can load/fire multiple JS/button in each div

Determine a way to identify the button. For example, if your page looks like this: <header> … </header> <section id=”songs”> <button>…</button> <button>…</button> <button>…</button> </section> … then you could get a list of buttons with: var buttons = document.getElementById(“songs”).getElementsByTagName(“button”); Then loop through the buttons, and call button.click(). 1 solved Html button who can load/fire multiple JS/button … Read more

[Solved] How to find my link in an external domain name [closed]

You have to do that on server side e.g. with PHP PHP(checkDomain.php): <?php $string = file_get_contents(‘http://www.shaarzh.com’); //Get external content $reg = ‘/example.com/s’; //Search pattern if(preg_match($reg, $string)){ $array = array(‘response’ => ‘true’); }else{ $array = array(‘response’ => ‘false’); } echo json_encode( array(‘response’=>’false’) ); //Response ?> Now you can call the PHP-script with JavaScript. JavaScript(jQuery): $.ajax({ url: … Read more

[Solved] How can I Bold First two words bold in a paragraph Dynamically? [closed]

You can achieve this as below: <!DOCTYPE html> <html lang=”en”> <head> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js”></script> </head> <body> <p class=”boldTwoWord”>How can I Bold First two words bold in a paragraph Dynamically?</p> <br/> <p class=”boldTwoWord”>I am trying to bold first two words in the Paragraph what can i do ? for that</p> </body> <script type=”text/javascript”> var elms = $(“.boldTwoWord”); … Read more