Skip to content

Category: Questions

remove a especific tr child of a table

EDIT: I forgot to mention that those TR were created dynamically. I’m trying to remove a especific TR that is inside a <tbody> when I click in the red X. I can identify the line I just cant remove it. What I tried: AND Any tips on how to select the corret TR? Ill post what i have. Answer First

how to get the value from an xpath

I try to get the value from a XPath, but I always get “undefined” “null” as answer that’s the HTML code from the XPath: and I tried it multiple times with: does someone have any idea? Answer You can get value by using: But DIVs do not have a value property. So you need to use ano…

Download shapes from leaflet map

I have online access to a leaflet map, but cannot reach the authors. Is there a way to download shapes from this map (to shp, geojson, etc.)? I thought of running some leaflet-related javascript code in browser console, but I couldn’t find any relevant commands in the documentation. Answer When you look…

How to replace Array in useState?

I want make program that table content is changed by user’s select. So I put empty array in useState, like this. And select html code: When I select option, data will be changed. But I don’t no how to do it with useState. These are data And my React code: I tried using map. But I don’t know …

Regex to extract text from a string

Given the following string: What is a javascript regex to extract the “firstName” and “lastName”? What is a javascript regex to extract the content minus the “[~firstName.lastName]”? I’m rubbish with Regex. Answer You could target each name separately. match will retu…

Vue.js component method on creation

I’m new to Vue and I’d like to make an AJAX call every time my component is rendered. I have a vue component lets say “test-table” and Id like to fetch the contents via an AJAX call. There are many such tables and I track the active one via an v-if/v-else-if etc. Currently I have a che…