-2

My string is like this

sakjgbsd aksdg's ad asidg's iasudgbsb

but when i print the string in function it prints only

 sakjgbsd aksdg

the part after (') is not printing

here is how i send data

<a href='#' data-status='" + data[i][col[j]] + "' " +
                            "onclick='submit(this)'>Click Here</a>

here is Function

function submit(str) 
{
var status = $(str).attr("data-status");
alert(status)
}
user
  • 357
  • 2
  • 5
  • 21

1 Answers1

1

Change your string to

`sakjgbsd aksdg's ad asidg's iasudgbsb` // backticks (sign under tilde ~)

or

"sakjgbsd aksdg's ad asidg's iasudgbsb"
Kamil Naja
  • 6,267
  • 6
  • 33
  • 47