Posts by Renan Gomes • 19,011 points
435 posts
-
4
votes1
answer40
viewsA: Chrome extension code problem
The problem is the selector itself, if check its return is null. You can use as selector: button[aria-label="Atualizar Widget Dashboard Fila Atendimento - Incidentes"] (function(doc) { 'use strict';…
-
1
votes1
answer64
viewsA: How to check if an element is visible with Javascript?
This is the expected behavior. As you are setting the property via CSS, this value will not be available when trying to get it using Javascript elemento.style.display (unless you define this value,…
-
4
votes1
answer353
viewsA: how to change input number value
Its element is a <input>. The same way you used the attribute .value to obtain the value, it is this attribute that you must use to define the new value, instead of the textContent. .value…
-
1
votes2
answers1567
viewsA: How to put an array as a function parameter in js?
Some points: The property is called length, nay lenght. You are comparing the index value instead of the content value at a given position, i == y is different from array[i] == y (if possible, use…
javascriptanswered Renan Gomes 19,011 -
0
votes2
answers57
viewsA: When selecting chekbox I need the phrase to be strikety. Follow img example
Based on your markup, you can use the input[type=checkbox]:checked ~ .text to define the stylization of the element with class text when the next checkbox is checked: input[type=checkbox]:checked ~…
htmlanswered Renan Gomes 19,011 -
2
votes2
answers814
viewsA: How to highlight/highlight words in text?
You can use the markjs for this: // cria uma instância definindo o elemento onde será "marcada" as palavras. var instance = new Mark(document.getElementById('source')) function highlight(word){…
-
0
votes1
answer106
viewsA: How popular is Jcombobox with an array of strings?
Can use: comboBoxPorta.setModel(new DefaultComboBoxModel(SerialPortList.getPortNames())); Example: import java.awt.BorderLayout; import javax.swing.*; public class Panel extends JFrame { String…
-
2
votes3
answers83
viewsA: Enable button only when two selects are different from 0
You can call a function that defines the value of the attribute disabled when there is change in one of the <select>: $(function(){ var animals = $('#animals') , sports = $('#sports') , button…
-
2
votes3
answers81
viewsA: How to capture a typed value and use to define the value of a class attribute (css)
You can do it like this: const percent = document.querySelector('.porcentagem') document.querySelector('input').addEventListener('input', function(event){ if(!this.value) percent.style.width = 0…
-
0
votes1
answer442
viewsA: Content of the div adjusting to its size?
Can use a width: 100% for the image to occupy the full width of the parent element: #controlImg { max-width: 400px; max-height: 500px; border: 1px solid red } #controlImg img { width: 100% } <div…
cssanswered Renan Gomes 19,011 -
0
votes2
answers238
viewsA: Problems with :checked css
This won’t work at all. The way your rule is .menu-mb would have to be a son of .mobile input:checked, which does not match your marking. What you can do is move the input=checkbox out of the…
-
1
votes1
answer115
viewsA: Two radio input dialing in the same buged form/header padding
The attribute name the elements must be equal so that it can control which option is selected. In your case, each one has a name: pessoal and empresa, so it doesn’t work. A <input name='selecao'…
-
1
votes3
answers472
viewsA: How to add a new key to a dictionary?
If in this challenge you can use Python’s own resources to work with Collections, there is the Counter which serves precisely this purpose: from collections import Counter sentence = 'teste conaz'…
pythonanswered Renan Gomes 19,011 -
4
votes1
answer479
viewsA: How to format datetime in a Flask application?
You can use the function strftime: <td>{{ form[f].last_seen.strftime('%d/%m/%Y') }}</td> Or create a specific filter for this. app = ... # instância do Flask.…
-
7
votes3
answers1969
viewsA: What’s the difference of using background to background-color?
background-color is a specific property to define the background color of an element. background is a "shortcut" that allows you to combine various background-related properties at once. Example: /*…
cssanswered Renan Gomes 19,011 -
4
votes1
answer80
viewsA: I’m not getting to call class in css in the conventional way
That is correct. It will not work with the dot in front as your html has no element with class="footer", only the element <footer> .footer { color: red } /* classe */ footer { color: blue } /*…
-
0
votes4
answers1230
viewsA: Put smooth transition with Javascript
Can have the same result using only html + css: input { display: none} h3 { opacity: 0; transition: opacity 500ms ease-in } input:checked + h3 { opacity: 1 } <label…
-
3
votes1
answer66
viewsA: Help with multiple Selenium Python Ivs
Using elements instead of element: self.otherPlayers = self.driver.find_elements_by_css_selector('span.text-ellipsis').text…
-
0
votes2
answers1123
viewsA: Animated Background in CSS
Using that codepen snippet that you provided in the question, just change the property background tag <body> to include an image, instead of the blue color that is now. body { background:…
-
1
votes3
answers164
viewsA: I can’t find the button with the querySelector
This here button.tabindex is looking for an element <button class='tabindex'>. Another point is that the element you are looking for has no class pull-right, soon the selector will not hit.…
-
0
votes3
answers1001
viewsA: Take an input value without Submit
You can get the same result as you would with jQuery: const anchor = document.querySelector('a') for(const item of document.querySelectorAll('input[name=tipo]')){ item.addEventListener('change', ()…
-
7
votes3
answers162
viewsA: How do I validate an input as its content changes?
No need to use Javascript (by the way, you don’t need JS for much stuff), not either jQuery. Use a model simple validation in <input> already gives you the expected result: input:invalid ~…
javascriptanswered Renan Gomes 19,011 -
2
votes1
answer65
viewsQ: Is exposing the PRIMARY KEY of an entity considered a serious security problem?
Considering a very basic example: suppose there is a web system in which the user can view his profile (and other users) through a unique identifier passed to a route, for example:…
-
4
votes1
answer286
viewsA: How to align an element at the bottom of the mother div?
Work with flexbox. You can single-align an element through the property align-self: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"…
-
4
votes2
answers1874
viewsA: Take custom attribute value "data-attribute" within a loop
You can make use of the API dataset(see support in "Can I use") to obtain the data-Attributes of a specific element: [...document.querySelectorAll('[data-selected]')].map(element => {…
-
5
votes1
answer76
viewsA: Is there any way to test a CSS animation by Devtools?
Firefox has the Animation inspector, in it you can "debug" animations as well as advance/regress the state of it to view what would be your behavior on the screen. Just open the developer tools…
-
2
votes1
answer278
viewsA: Beautiful Soup - Remove a tag keeping Text
Can use unwrap(): from bs4 import BeautifulSoup as bs soup = bs('<p>Projeto N <sup>o</sup> 00.000, DE 00 DE JANEIRO DE 0000.</p>') soup.sup.unwrap() # <sup></sup>…
-
4
votes3
answers94
viewsA: List with dynamic size
I believe what you need is the auto layout Columns. Just don’t specify the size of the column and let Bootstrap himself take care of it. I think "under the covers" is used flex layout, because the…
-
10
votes2
answers1303
viewsA: Require to mark at least 1 checkbox
You can change the type of the checkbox for radio and include the attribute required to make it mandatory: <form> <div> <label for='sabonete-liquido'>Sabonete Líquido</label>…
javascriptanswered Renan Gomes 19,011 -
2
votes2
answers125
viewsA: Doubts about the Use of Beautifulsoup
The problem is in the selector you are looking for, there are several <div> with these three classes together across the page. The ideal is to try to create a selector that is as specific as…
-
2
votes1
answer93
viewsA: How to add this "bar" above the menu? HTML+CSS
Is only one border-top: html, body { margin: 0 } header { border-top: 3px solid #F48024; box-shadow: 0 0 10px 2px #ccc; height: 40px } <header></header>…
-
4
votes1
answer142
viewsQ: What are the differences between macros and constexpr? When is it preferable to use one instead of the other?
I haven’t been in touch with C++, until I decided to create a project to test a solution. As I knew before, I created a macro to use a value as "constant" later, example: #define MAX_ENTRIES = 10…
-
4
votes4
answers9348
viewsA: Put an IF in CSS
Can create a input defendant, who owns a pattern that the valid format is at least one character. And then use :valid to display the content when the condition is met: .search-list { display: none }…
-
1
votes2
answers127
viewsA: How do I remove the <input type="reset"> border without removing my css border?
The ideal would be to style the element itself instead of creating a wrapper to the reset, This only tends to complicate more how you’re applying styling to the elements. At first, if it is only the…
-
1
votes1
answer537
viewsA: Change font size dynamically javascript
You can get the value of the font size through the function window#getComputedStyle and CSSStyleDeclaration#getPropertyValue(), and then just do the treatment as per your need. In a case that is…
javascriptanswered Renan Gomes 19,011 -
3
votes3
answers126
viewsA: creating note/observation field
There are 'n' ways, if you’re only thinking about the visual issue, you can use a border-left to put that green one on the left. div { background: #FF0; border-left: 5px solid #0F0; font-family:…
-
2
votes1
answer204
viewsA: Working with after and before css to add items on the screen
You can use the same technique of that answer and use a checkbox as controller of which item is selected. The question of placing the ball in the upper corner, just set the parent element with…
-
2
votes2
answers267
viewsA: How to get the value of a select item by clicking on it
Just get the attribute value: document.getElementById('lst').addEventListener('change', function(){ console.log('valor selecionado: ' + this.value); }); <select id="lst"> <option…
-
1
votes2
answers287
viewsA: Continuous Jquery Bounce effect
You can create this type of animation with CSS only, just change the value of the property scale the button in question. Using @keyframes together with the property animation: @keyframes bounce {…
jquery-uianswered Renan Gomes 19,011 -
0
votes3
answers47
viewsA: Getting text from an element
There are two problems with your code. The first is that the query for this class will return null since you are looking for .perfil-sistema when the class name in your html is .perfil-usuario.…
javascriptanswered Renan Gomes 19,011 -
1
votes1
answer47
viewsA: Problem to convert SCSS to LESS
There are two problems: the first is that you are using functions that do not exist in LESS, the second is that the function darken() requires a valid color, and in the case of your code this is not…
-
4
votes6
answers4316
viewsA: Know number of checkbox selected
With CSS counters you can "set a variable" to be incremented whenever a rule marries. In case, how do you want to count how many <input> are with the attribute :checked true, enough:…
-
4
votes4
answers1177
viewsA: Minimum quantity jquery
When all browsers have support, you can use the attribute min-length in HTML. You can follow by this link which browsers already have this feature currently. Still, you do not need to use Jquery to…
-
3
votes2
answers3282
viewsA: Read . txt files and put them in an Arraylist
You can use the method Files#readAllLines(): Path path = Paths.get("C:", "ferramentas.txt"); // C:\ferramentas.txt List<String> linhas = Files.readAllLines(path); Running on Repl.it…
javaanswered Renan Gomes 19,011 -
0
votes1
answer352
viewsA: Return Web Service is a string, how can I query the data?
If you have an object Record with the attributes descricao and codCusto, can use the Jackson or the Gson to map JSON keys to class attributes. In that question there are some differences between…
-
2
votes2
answers1429
viewsA: Hover with two effects: increase and decrease width of different Ivs
Still it is possible not to use Javascript for this, using only flexible layout. The only important point to consider is the question of property support, but as nothing was mentioned in the…
-
25
votes3
answers10654
viewsA: How to make a progress bar ranging from 0 to 100% with CSS only?
My idea follows the same of Wallace’s answer, with the alternative of not having to create more than one html element to deal with the "internal" progress look, the bar that increases the property…
-
9
votes2
answers1056
viewsA: Top 50% Edge and Bottom Edge 50% with css, is it possible?
There are probably better ways to solve this, perhaps with SVG. But using only CSS, one way is to use pseudo elements ::after and ::before to create two squares "behind" the div, one in the upper…
cssanswered Renan Gomes 19,011 -
1
votes1
answer252
viewsA: Input in javafx
You can make N_BARS class attribute, can be changed from any method of Ilusao before the method drawIlusion be called to draw the elements. Another solution is to parameterize the method drawIlusion…
-
1
votes1
answer182
viewsA: String for Array/List
I would follow the same idea of comment from @Francisco, create an object that maps the monster’s attributes: nome, hitpoints and level, although I would not use them per hour in my application.…