Posts by OtavioCapel • 1,513 points
60 posts
-
2
votes2
answers48
viewsA: Simple email field in Javascript
You can create a regex and use the method search searching in the string o regex valet. in the example I search in the string o @ and a . if there is @in the string it returns the position it is in.…
javascriptanswered OtavioCapel 1,513 -
1
votes1
answer509
viewsA: Change a component through another component - Angular 8
You can validate it through the route, only show the logo if the route is different from /home. First you need to import the router: import { Router } from '@angular/router'; then add into the…
-
1
votes2
answers897
viewsA: How do I use the properties of a parent element in the child’s CSS?
Use the property inherit with her you inherit the value of the parent tag: #filho{ max-width: inherit; } So he’ll get the max-width tag father. NOTE: as the property inherits the value of the parent…
-
1
votes1
answer308
viewsA: What does "!!" mean in Typescript?
The '!! ' is when you are denying a denial. Example x = false; console.log(!x) // true; console.log(!!x) // false; It is not exclusively typescript, it is the negation signal. Can be used together…
-
3
votes2
answers145
viewsA: Return certain array values
Use the method splice, passing the start and end position parameter to assign the first 5 positions in a new array; Ai in his ngFor use the array created for iteration. let api = [ { "id": 44,…
javascriptanswered OtavioCapel 1,513 -
5
votes1
answer116
viewsA: Edge some of thead th when giving scroll (scroll page)
What causes this is border-collapse: collapse;, solved using the border-collapse: separate; and used the position: sticky and top: 0 to fix the thead when using Jquery. * { padding: 0; margin: 0; }…
-
1
votes1
answer124
viewsQ: position: Sticky together with overflow;
there is a way to make position: sticky and overflow-x: auto work together, without setting values of height? In that structure I set overflow-x: auto in my class .scroll, mine position: sticky tag…
-
2
votes1
answer225
viewsQ: Apply Inline Hover to another table in HTML
In my HTML there are two separate tables, and in all my tags tr contain a hover applied in the CSS. My question is the following: when passing the mouse on a tag tr of a table it is possible to…
-
0
votes1
answer36
viewsA: Changing the font-size of the field with value coming from the database
You can use the [ngStyle] as function return, example: vrFonte: number setStyles() { let styles = { 'font-size': this.vrFonte || '13px' }; return styles; } //OBS: 'font-size': this.vrFonte || '13px'…
-
1
votes1
answer234
viewsQ: Doubt table header
I’m trying to get a tag th has two lines and the first line occupies the width the whole of the parent tag, and that the second row be divided into 4 columns. However I could not reach this result…
-
4
votes4
answers431
viewsA: Dynamically change class
Well try to use the ng-class with the if ternary . <div class="row p-3 border-bottom" *ngFor="let cont of contrib"> <!-- ! --> <div class="col"> <p ng-class="redName ?…
-
0
votes1
answer92
viewsA: I’m trying to customize my bootstrap template but there are no changes to the page
In the html we don’t need to put a . in the css classes, this is only required in the file .css which indicates that you will style a class. .bg.wallpaper { background-image:…
-
1
votes2
answers851
viewsA: Keep changing font color with CSS only
in the css there are the @keyframes where you can create animations only with html and css. The @keyframes rule By specifying CSS styles within the @keyframes rule, the animation will gradually…
-
0
votes1
answer230
viewsA: Save() method of Mongoose not saved
You can use the method Model.create() where it creates a record in your database from its model: try { const projectModel = await projectModel.create({teste:"teste"}); return projectModel ; }…
-
7
votes4
answers6855
viewsA: Execute function when losing focus of an input
The very one Javascript has the function onblur performing a particular action or function when the input lose focus (be clicked out): function teste(){ console.log('teste') } <input…
-
1
votes1
answer609
viewsA: Change form depending on radio button - Angular 2+
Well I didn’t understand much of your code, and I did it in a way that I thought (I don’t know if it’s the best way and best practice to do) but leave here an example for you: used inputtype radio…
-
1
votes1
answer354
viewsA: Make Calculator Using an Angular Dropdown
Well first I created a function that receives as parameter the operation that the user wants to do, and added in html a tag p that receives the variable result, after filling this variable the value…
-
1
votes2
answers3978
viewsA: I can’t change directories in Git Bash
the correct command is cd Users/Gustavo there is a space between cd and directory to access.
-
1
votes3
answers571
viewsQ: position: Sticky; does not work
I’m trying to get the thead table keep position: sticky, so always stay at the top of the scroll, but it’s not working and I can’t find a solution. NOTE: I am using Bootstrap and the class…
cssasked OtavioCapel 1,513 -
3
votes1
answer90
viewsQ: position Fixed only horizontal
I’m having a question, I was wondering if it’s possible to leave my div with position: fixed only horizontally and vertically... It’s possible to do that? .body{ height: 1500px; width: 1500px;…
cssasked OtavioCapel 1,513 -
-1
votes2
answers525
viewsA: How to fix CORS error in Node.JS? (Web Crawler)
you can make a npm install cors --save ai in your main Node file (index.js or server.js usually) do const cors = require('cors'), and then make a app.use(cors()), where app would be your server…
-
6
votes2
answers1765
viewsA: Position an image correctly within a div
If you’re interested I solved it a little differently using flexbox css, see the example. .side-menu-user-info{ background: #FFF; display: block; height: 190px; border-bottom: 1px solid rgb(155,…
-
1
votes1
answer163
viewsA: How to add value to an input without removing the value that is already there?
I used only a validation and concatenation to get the result of a look at the example, if case input2 has no value I assign the value of the first input to the input2, if the input2 I only do the…
-
3
votes2
answers299
viewsA: Send the value of one input to another input that is readonly
Good Day I did using the getElementById and setting values. function setValue () { var nome = document.getElementById('inputNome').value; document.getElementById('textNome').value = nome; };…
-
0
votes2
answers50
viewsA: How to align a form next to an iframe?
There is more than one way to arrive at the expected result... The form I used was through the display: flex with the property justify-content: space-between that leaves the child elements next to…
-
1
votes1
answer44
viewsA: List within the Section
Good afternoon, just use the property overflow: auto that upon reaching the maximum size of the Section it creates a scroll bar. #racetype{ display: flex; flex-direction: column; background-color:…
-
0
votes2
answers50
viewsA: Questions about Scroll Avascript
The javascript has the object window who owns the property scrollY where it shows how much of scroll was made in the page... try to use console.log(window.scrollY) div{ height: 2000px; } <div>…
javascriptanswered OtavioCapel 1,513 -
1
votes2
answers1083
viewsA: Calling JS function by Select
According to the Jquery documentation you can do so $(seletor).change(function() { logica da função }, try to use this way to the power of .on('change'). And preferably for selectors with id as I…
-
0
votes1
answer24
viewsA: Doubt when executing the function
Face this concept is called De-structuring, it kind of consists of you creating a variable with the name of the object attribute passing as value the object... Example: var obj = { nome: 'joao',…
-
2
votes2
answers50
viewsA: Redeem values from an array when the value is greater than x
You can use the function map traversing the array and checking whether the amount is greater than or equal to 4: You can use it with an object array, or even an array only of numbers by checking…
-
0
votes2
answers40
viewsA: Side-by-side images aligned on any screen
If you need images side by side, you can use the display: flex with the properties, justify-content: center; and align-items:center; that they will align all the contents of their div side by side.…
-
0
votes4
answers519
viewsA: Remove last space from a variable
You can use the function trim, basically the Trim function removes existing whitespace before and after a string. trim($name)
-
1
votes3
answers1008
viewsA: How to put a link inside a String?
Just use different quotes with which you opened the string. (function(){ var results = [ { text: 'Quero colocar um link aqui exemplo <a href="#"> Link </a>' }]…
-
1
votes4
answers3686
viewsA: Summing value by value in an array with Python
You can use the function sum() python passing parameter the array you want to receive the sum. So if you use sum(valores) he returns the result.
-
3
votes3
answers342
viewsA: Add a new label to every button click
You can use the innerHTML through javascript to do this. I created a div just to say where I want to create one more element, so I take this element with querySelector by javascript and use the…
-
1
votes1
answer89
viewsA: How to apply saved CSS code within an array using Angularjs?
I think it would be easier for you to create the style you want inside the file .css. And to validate on HTML there is the directive in Angularjs called ng-class where you can assign a style with…
-
2
votes3
answers371
viewsA: Create widget with "onclick()"
Use the nomeDoElemento.click(). inputExc.click(nomeDaFunção) or can create a function: inputExc.click(function(){ })
javascriptanswered OtavioCapel 1,513 -
7
votes1
answer169
viewsA: How to store the returned Strings of the split() method in different variables?
When using the method split your string becomes an array, then just create the variables and set which position of the array you assign value to that variable. String frase = "João Medeiros -…
javaanswered OtavioCapel 1,513 -
2
votes1
answer30
viewsA: D3.JS: Variable with getElementById default value
You can do it like this: var honeyyear = document.getElementById("vardatayear") || 2013; case document.getElementById("vardatayear") is null or does not exist to var honeyyear comes with 2013 value.…
-
2
votes2
answers68
viewsA: Flexbox width being exceeded
Here I used the width: inherit the attribute inherit inherits the width of the parent element, thus not allowing the one child element to surpass the parent element.. html, body {width: 100%;height:…
-
1
votes2
answers32
viewsA: How do I identify which element/pseudo-element I have to pick up to assign some styling (css)?
Well the id you should use when you want only that element to have its own style. In the html you assign a id to the element in that way id="umId" and in the css to style this id you use #umId. With…
cssanswered OtavioCapel 1,513 -
2
votes2
answers341
viewsA: How to store the value of an input type number in a JS variable
All you have to do is close the keys, but there is a property onchange. With the property onchange each time you change the value of the input it calls its function add(), thus altering together the…
javascriptanswered OtavioCapel 1,513 -
8
votes2
answers123
viewsA: Why doesn’t my class apply the style I set to the "H1" tag?
The correct is <h1 class="fonte-style-h1">Oie CSS!</h1> in the attribute class we don’t need to put the same point in the css file. You only need to remove the point of <h1…
-
0
votes4
answers124
viewsA: Insert Parentheses between an acronym in the input field
I made some adjustments here, and it worked if the user enters the parentheses the function does not insert more. see if anything helps you post a comment that helps you. function maiusculo(){ var…
-
1
votes1
answer35
viewsA: Doubts about CSS applying effect on one div without changing the other
According to the comment of our friend @Getulio Rafael Ferreira who provided the link of a similar question. You can make use of background-color: rgba(250,0,0,0.6); that will bring the effect you…
-
1
votes2
answers60
viewsA: How do I continue the repetition until no S/N conditions are entered?
You can use the repeat loop do while. The do while performs a function first and checks until the condition is false to stop the execution. Take a look here to understand more sinking…
javaanswered OtavioCapel 1,513 -
1
votes1
answer109
viewsA: Print specified JSON value
You just mapped the wrong print print(data["output"][0]["text"]), the correct would be print(data['output']['text'][0]). Or print(data['output']['text']) if you want to print all the contents of…
-
2
votes3
answers24130
viewsA: HTML button go to link
You can create a function with the method window.location.href = "URLaSerRedirecionada"; and call this function in the click, or call the direct method with onclick; <button…
-
2
votes2
answers1617
viewsA: Create input with fixed value
Well, I don’t know if that’s the best way to do it. I created a div simulating the input, with the input readonlyinside and with another input textnext to it, making it possible to edit the value…
htmlanswered OtavioCapel 1,513 -
2
votes1
answer37
viewsA: When I run on html the classification always shows Undefined, but when I run on the console it brings the answer of the _class variable can anyone help me?
You just need to change your line of code document.write(`Classificação:${_class}`); towards the end of its logical condition. There your variable _class will already be filled. //função que…