JavaScript How to select class element inside div in jquery select class element javascript,select class element jquery,select class

I am trying to implement the smooth scrolling effect described here jquery smooth scroll to an anchor? using Godaddy's Website builder tool. Unfortunately the tool adds lots of its own boiler-plate code and my own markup ends up inside it. It seems therefore that the jquery script is never called and instead of the smooth scroll effect, I have the usual "jump" to the target section.

The tool-generated markup is as follows, where the external div element has been added and "wraps" my own markup (anchor element):

<div class="wsb-htmlsnippet-element"><a class="scroll" target='_blank' href="#things">Supported Things</a></div>

In a simular way the target element id is also enclosed in a div:

<div class="wsb-htmlsnippet-element"><section id="things"><h2>Supported Things</h2></section></div>

How should I modify the original script, which is reproduced below in order to make it work no matter how much additional divs (or other elements) the Website builder tool uses to wrap my own custom markup?

$(".scroll").click(function(event){
   event.preventDefault();
   //calculate destination place
     var dest=0;
     if($(this.hash).offset().top > $(document).height()-$(window).height()){
          dest=$(document).height()-$(window).height();
     }else{
          dest=$(this.hash).offset().top;
     }
     //go to destination
     $('html,body').animate({scrollTop:dest}, 1000,'swing');
 });
Answer:1

To select a class element inside your div:

$("div.wsb-htmlsnippet-element").find(".someclass").click(function(event){
 . 
 .
 . 
});
Answer:2

So I am trying to make a dynamic quiz and am struggling with adding text to my radio inputs. I use a for loop to make several radio inputs. I would like the text to be on the same line as each radio ...

So I am trying to make a dynamic quiz and am struggling with adding text to my radio inputs. I use a for loop to make several radio inputs. I would like the text to be on the same line as each radio ...

  1. jquery same text
  2. jquery find same text

I have input type=file for upload file. When I choose 2-3 files, I have list of file. How can I delete only one object which I choose? <input type="file" data-ng-click="initFiles2()" data-rule-...

I have input type=file for upload file. When I choose 2-3 files, I have list of file. How can I delete only one object which I choose? <input type="file" data-ng-click="initFiles2()" data-rule-...

  1. delete object from array javascript
  2. delete object from array
  3. delete object from list python
  4. delete object from s3 bucket
  5. delete object from photo
  6. delete object from object javascript
  7. delete object from memory python
  8. delete object from vector c++
  9. delete object from photo in photoshop
  10. delete object from array java
  11. delete object from json array
  12. delete object from s3 bucket java
  13. delete object from arraylist java
  14. delete object from dict python
  15. delete object from array typescript
  16. delete object from array python
  17. delete object from list c#
  18. delete object from s3 boto3
  19. delete object from workspace r
  20. delete object from json javascript

There is a public website with this in the source: </div><script type="text/rocketscript"> function calculateIndexIncome() { var khs = $('#t9').val(); var btcusd = $('#t9_1').val()...

There is a public website with this in the source: </div><script type="text/rocketscript"> function calculateIndexIncome() { var khs = $('#t9').val(); var btcusd = $('#t9_1').val()...

  1. extract string html python
  2. extract string from html
  3. extract string from html java
  4. extract string between html tags
  5. extract text from html string
  6. extract text from html string python
  7. python extract string between html tags
  8. javascript extract string from html
  9. extract text from html string javascript
  10. extract text from html string c#
  11. extract body from html string
  12. bash extract string from html
  13. extract data from html string
  14. c# extract string from html
  15. extract value from html string
  16. php extract string from html
  17. extract text from html string java
  18. extract text from html string using jquery
  19. regex extract string from html
  20. extract json string from html

<html dir = rtl> <head> <title> </title> <meta HTTP-EQUIV="Content-language" CONTENT="ar"> <script type="javascript"> function d(...

<html dir = rtl> <head> <title> </title> <meta HTTP-EQUIV="Content-language" CONTENT="ar"> <script type="javascript"> function d(...

  1. check text html ratio
  2. checkbox text html
  3. check input text html
  4. sublime text check html syntax
  5. javascript check html text
  6. jasmine check html text
  7. sublime text check html
  8. check if text is html
  9. check if text is html c#
  10. check if text contains html
  11. check if text has html tags
  12. html check text length
  13. check if text contains html tags
  14. check if text contains html c#
  15. check if text is html swift
  16. js check text is html
  17. check bold text in html
  18. php check text html