in Education by
var EventAddress=$(".EventAddress").text(); $(".EventDirectionLink a").attr("href", url + EventAddress); This is the jquery I am using to get the address value from the table cell and pass it to the map url as a query string but its not working? What am I doing wrong??
Who Should Enroll?: Everyone 18 and older who would like to attend
Location: 1300 Albany Street,Beech Grove ,IN
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Try this: $('td.EventAddress').click( function(){ $(".driving-directions-link a").attr("href", $(this).attr('href') + encodeURIComponent($(this).text)); }); JS Fiddle demo. Simplified the above a little, to avoid using the .attr() method twice (the second time unnecessarily): $('td.EventAddress').click(function(){ $(".driving-directions-link a").attr("href", function(i, h) { return h + encodeURIComponent($(this).text()); }); JS Fiddle demo. References: attr(). click(). encodeURIComponent. text().

Related questions

0 votes
    I wanted to find a way to extract from the url the classes to be added to the body. I made some ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I wanted to find a way to extract from the url the classes to be added to the body. I made some ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am using jquery ajax get. SO when my form is submitted it then submits to a php file but the ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I am using jquery ajax get. SO when my form is submitted it then submits to a php file but the ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Which type of remote URL does not require your user-name and password while for cloning or pushing? A. SSH url B. Https Url...
asked Dec 17, 2022 in Technology by JackTerrance
0 votes
    Good Day All I am completely new to this type of query but is it possible to define a url on a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I had to add some ugly links in my website that looks like: "/page/?utm_source=value&utm_source= ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    In the context of computing, what is the full form of URL ? 1. Undistributed Resource Locator 2. Unified Resource Locator 3. Uniform Resource Locator 4. Uniform Region Locator...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    I have many automated integration tests. Some of them are negative-case tests, which make sure that my ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    I need to check if url exists and can be reached. In order to do it I send Get request and ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 23, 2022 in Education by JackTerrance
0 votes
    I want to load a html page from a file, and append a hash tag to it. Is this possible? I ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
0 votes
    My websocket application accepting connections like this: wsServer.on('request', function(request) { console.log( ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I have worked spring boot + testcontainers test based on JUnit 4. Example: @RunWith(SpringRunner.class) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I'm trying to figure out a solution to allow an website to know what URL the user is on through ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    When I use ajax call from a modal window, the request url seems not correct. I have a webserver ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
...