Get number with javascript [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a Javascript Bookmarlet, in which I want to grab a price that might be displayed on the current page.
So for example on shopping sites it could grab the price of an item the user is currently looking at.
I figured one way would be to grab all the text on the page, perhaps with something like get web page text via javascript
And then from there filter to get just the number after a currency symbol is found (£,$ etc) which should in theory leave just the Price.
However I am now sure how I would go about actually filtering to just the number, and if this is at all the right way to go about this?

How about get the text value of mark up?
E.g. Say you had:
<span id="price">£5.00</span>
You could do the following with jQuery:
$('#price').text();
Or vanilla javascript:
document.getElementById('price').innerText
Provided there is infact a wrapper around the text or you have access to the markup.

Related

what is the fastest way to find what component is showing that particular div on the DOM? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
Here is my current way of finding what component is showing that particular div:
I copy the class name (I use Tailwind, so I mostly get unique classes) or hardcoded text that is present and search for it in my project, then I figure out on which component that name or text is present.
but i was wondering if there is any faster way to find it?
Try using the Locatorjs chrome extension. Enable the extension and in localhost hover over the component in UI for which you want to see the code. In mac, OPTION + CLICK will take you to that particular code.Locatorjs

How to make textarea with tagging feature like in Youtube [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to create a textarea that behaves like the tagging box in Youtube. Specifically:
Allow you to type whatever you want
When you press space it turns the word you just typed into a tag
You can remove tags with backspace or by clicking x on tags
Show suggestions as you type
You can add tags from outside the textarea as well
Also, what exactly is this method called?
I just used a javascript library 2 days ago that does excatly this. Check out the TextExtJs library

How to get primefaces elements value with javascript [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have a primefaces project and I'm facing a problem. I have a simple HTML component which is an input element of type hidden which gets its value from a backend bean. Now I need the value of that component as a javascript variable in order to validate it.
How can I access the value from the hidden input element?
For the next time, please post what you have tried so far. You can't expect us to write code for you. Show a little bit of effort. But because in that case it is not too much:
If you have something like this
<input id="myHiddenComponent" type="hidden" value="something received from your bean" />
you can access it with jQuery for example
$('input#myHiddenComponent').val();
If you dont know the id, you can use other jQuery selectors and the jQuery find as well, pick one which suits you.

Little box where I could write in [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I would need to use a little textbox in order to write in and to get the value but without creating a window. (In which I would have created a textbox element)
I would need something like the alert box but I would like to write in.
Do you know what I could use ?
To get an dialog box with input using javascript you can use window.prompt, look for more info here.
If you want something prettier go for a modal window. There are plenty plugins for jQuery (and there should be enough scripts available in vanilla JS as well) to achieve this.

need some help for a image slide show? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
On my first day of work with html I built a navigation bar yesterday which looks pretty sweet to me ...take a look at it here
Now I want to include a slideshow like thing in my site next probably using some javascript or jquery plug ins...I am looking for something similar to the one at www.forward.co.uk/ (the text on the image looks a pretty good to me)
I have searched on github too ..but the results i got did not match the style i want ..probably my keywords for the search were not too precise..
try this
http://jsfiddle.net/JhVsn/1/
or this ( only for text)
http://jsfiddle.net/JhVsn/2/

Categories

Resources