Questions tagged as 'javascript'

3
answers

Mask with Jquery changing from fixed to mobile or vice versa

I have a JQuery mask for phone, depending on how much information the user type I understand if it is cell phone or landline. The fixed mask: (55) 9999-9999 for mobile: (55) 99999-9999 the mask code: $("#Telefone").keydown(function () {...
asked by 18.08.2017 / 17:30
2
answers

How to check if HTML tag has certain attribute with JS?

In this code: <img id="SizeImage1" style="cursor:pointer"> As you can see, it has no attribute src . How can I tell if a tag has src or not using JavaScript?     
asked by 22.11.2016 / 15:15
3
answers

There is a useful way to highlight an HTML element / tag in a given color

Well, I want to set a color to the tag style. The following example changes the style of an element <p id="tag"> parágrafo </p> To change the style of an HTML element, use this syntax: <script> document.getEleme...
asked by 25.01.2017 / 05:01
2
answers

Browser problem

I'm new to web development and I'm having a problem that I think is more basic, but it's causing me problems. When I change my CSS, JS or HTML and refresh the page in Chrome to review the site and see how it got, the site continues with the old...
asked by 11.01.2017 / 21:54
1
answer

I wanted to know how to create variables through for in javascript?

I am creating a page with javascript that has a lot of variations that only changes as in the section below var divClearFloat1 = document.createElement("DIV"); var divClearFloat2 = document.createElement("DIV"); var divClearFloat3 = docu...
asked by 22.12.2016 / 00:21
2
answers

Checking if value exists in an array via search field

In pure javascript I can use indexOf() , something like this: var chaves = ['wmv','3gp','mp4','mp3','avi']; if(chaves.indexOf("avi") != -1) { alert("Ok!"); } But when it comes to a search field I'm trying this way: <html...
asked by 26.12.2016 / 20:29
3
answers

Make Transition From Javascript Evolution To Cross Browser

I see this need, which people like me self-taught, try to understand. The question is - Nowadays some features are already supported by the main browsers HTML5, CSS3, DOM, APIs and ECMAScript ... being very Javascript , is not my case, bu...
asked by 30.06.2016 / 18:14
2
answers

How to replace "NAN" with 0 in Javascript

Well, what I intended was to replace the word "NaN" in javascript by 0. I've already looked for some topics here in stackoverflow but none helped me. What would be the code to make this change? Thank you. @EDIT: I tried to do this...
asked by 02.06.2016 / 19:26
2
answers

Show animation while loading?

I have not found much about this subject in tutorials, I do not know if anyone else has noticed that services like Facebook, Netflix use a kind of load before showing the content, both seem to work the same way, in some tutorials said that this...
asked by 13.10.2016 / 23:11
2
answers

JAVASCRIPT: Sort HTML list by name and age

Good evening, I need to sort a list of HTML phrases by user name or by age, depending on which button is clicked. How can I do this? Below is a clearer version of the code: <html> <head> <title>JS</title> <...
asked by 27.06.2018 / 23:56