6 Replies - 712 Views - Last Post: 20 February 2013 - 12:15 AM

#1 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

remove jquery returned results?

Posted 19 February 2013 - 08:38 PM

I use jQuery to show a string, and add a remove button next to the string. How do I give the button the ability to remove the string? (both the string and the button do not show up in the HTML source because they are output from jQuery.)
Is This A Good Question/Topic? 0
  • +

Replies To: remove jquery returned results?

#2 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 440
  • View blog
  • Posts: 1,867
  • Joined: 30-April 10

Re: remove jquery returned results?

Posted 19 February 2013 - 10:27 PM

What have you tried?
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,250
  • Joined: 08-June 10

Re: remove jquery returned results?

Posted 19 February 2013 - 11:36 PM

View Postg37752, on 20 February 2013 - 04:38 AM, said:

How do I give the button the ability to remove the string?

it depends on how accurate you can pinpoint that text in the document (with Java​Script)
Was This Post Helpful? 0
  • +
  • -

#4 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

Re: remove jquery returned results?

Posted 19 February 2013 - 11:41 PM

i made the string and the remove button in the same div, giving the div an id. then the problem is the element cannot be found.
Was This Post Helpful? 0
  • +
  • -

#5 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,250
  • Joined: 08-June 10

Re: remove jquery returned results?

Posted 19 February 2013 - 11:50 PM

that’s the point where we would need to see the code.
Was This Post Helpful? 0
  • +
  • -

#6 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

Re: remove jquery returned results?

Posted 20 February 2013 - 12:13 AM

to clarify,

i have a div, in which i use jQuery to write line by line. i can do clear-all to remove the whole thing (by
html('');
). now i need to be able to remove them by selecting a line. i tried to id the lines on the fly which will not work because the elements cannot be found in HTML source.

so i think i have to prepare a div for each line and id each line in advance. the problem is i don't know how many lines there will be. now if i know the maximum available lines is 150, then i will have to prepare 150 divs (or tr's) upfront? is there a smarter way?

This post has been edited by g37752: 20 February 2013 - 12:16 AM

Was This Post Helpful? 0
  • +
  • -

#7 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,250
  • Joined: 08-June 10

Re: remove jquery returned results?

Posted 20 February 2013 - 12:15 AM

View Postg37752, on 20 February 2013 - 08:13 AM, said:

is there a smarter way?

how should I know? I do not know anything about your jQuery or your HTML.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1